D:\jknuba_2024_winter\j_MAXIMA_Iam\jh_k123_Rectangle_v1.wxmx
Rectangle

Задача. Визначити силу тиску на плоску прямокутну поверхню шириною B=3 м та висотою H=7 м. На вільній поверхні рідини атмосферний тиск .

--> kill(all);

\[\]\[\tag{%o0} \ensuremath{\mathrm{done}}\]

--> ro:1000;g:9.81;H:7;B:3;p_m:10000;

\[\]\[\tag{%o1} 1000\]

\[\]\[\tag{%o2} 9.81\]

\[\]\[\tag{%o3} 7\]

\[\]\[\tag{%o4} 3\]

\[\]\[\tag{%o5} 10000\]

--> del1:H/15,numer;del2:H/10,numer;del3:H/7,numer; del4:H/5,numer;del5:H/3,numer;

\[\]\[\tag{%o6} 0.4666666666666667\]

\[\]\[\tag{%o7} 0.7\]

\[\]\[\tag{%o8} 1\]

\[\]\[\tag{%o9} 1.4\]

\[\]\[\tag{%o10} 2.3333333333333335\]

--> dh:H/5,numer;

\[\]\[\tag{%o11} 1.4\]

--> 'integrate((ro·g·(Hh))·B,h,0,H);integrate((ro·g·(Hh))·B,h);

\[\]\[\tag{%o12} 29430.0 \int 7\mathop{-}h{\, dh}\]

\[\]\[\tag{%o13} 29430.0 \left( 7 h\mathop{-}\frac{{{h}^{2}}}{2}\right) \]

--> pi(h):=9810.0·(Hh);

\[\]\[\tag{%o14} \mathop{pi}(h)\mathop{:=}9810.0 \left( H\mathop{-}h\right) \]

--> P:integrate(ro·g·(Hh)·B,h,0,H);

\[\]\[\tag{%o15} 721035.0\]

--> if P<10 then scale:3 elseif P<100 then scale:20
   elseif P<1000 then scale:200
   elseif P<10000 then scale:2000
   elseif P<100000 then scale:20000
   elseif P<1000000 then scale:200000
   elseif P<10000000 then scale:2000000
   ;

\[\]\[\tag{%o16} 200000\]

--> pi(0);pi(0)/scale;

\[\]\[\tag{%o17} 68670.0\]

\[\]\[\tag{%o18} 0.34335\]

--> 'integrate(ro·g·((Hh)··2)·B,h,0,H);

\[\]\[\tag{%o19} 29430.0 \int {{\left( 7\mathop{-}h\right) }^{2}}{\, dh}\]

--> mP:integrate(ro·g·((Hh)··2)·B,h,0,H);

\[\]\[\tag{%o20} 3364830.0\]

--> h_D:mP/P;h_D_:Hh_D;

\[\]\[\tag{%o21} 4.666666666666667\]

\[\]\[\tag{%o22} 2.333333333333333\]

--> x_draw:3·B;y_draw:H+2;

\[\]\[\tag{%o23} 9\]

\[\]\[\tag{%o24} 9\]

--> n: h_D_;mod(n,1);

\[\]\[\tag{%o25} 2.333333333333333\]

\[\]\[\tag{%o26} 0.33333333333333304\]

--> /* make float to string */;
--> if floor(n·100)/100>0 then n:floor(n·100)/100 elseif floor(n·1000)/1000>0 then n:floor(n·1000)/1000;

\[\]\[\tag{%o27} \frac{233}{100}\]

--> n:n,numer;

\[\]\[\tag{%o28} 2.33\]

--> hh:sconcat(n);

\[\]\[\tag{%o29} "2.33"\]

--> hh;

\[\]\[\tag{%o30} "2.33"\]

--> pp:sconcat(P);

\[\]\[\tag{%o31} "721035.0"\]

--> pp;

\[\]\[\tag{%o32} "721035.0"\]

--> /*  p_:printf(false, "~d", n);stringp(pp);p_;n;  */;
--> /*  https://sourceforge.net/p/maxima/mailman/maxima-discuss/thread/34939E59-E2C1-484B-A0CF-C6D70CB9E835@peterpall.de/   */;
--> scale_p:pi(0);

\[\]\[\tag{%o33} 68670.0\]

--> draw2d(xrange = [5,x_draw],
yrange = [0,y_draw],
  font      = "Arial",
           font_size = 16,
title="Rectangle",
   xlabel = "Presure, Pa",
ylabel = "h,m",
  grid = true,
  proportional_axes=xy,
  line_type = solid,
   color = black,
  fill_color = "#cccccc",
line_width=1,
rectangle([0,0],[B,H]),
  line_width=2,color=blue,
   water:polygon([[3,H],[1,H]]),
water:polygon([[0,H],[B,H]]),
   color=black,line_width=1,
  head_both = true,
  head_length = 0.2,
  head_angle = 10,
vector([0,H+del1],[B,0]),
  label(["B",B/2,H+del3]),
    points_joined = true,
  points([[0,H],[0,H+del2]]),
  points([[B,H],[B,H+del2]]),
  points([[B,0],[B+del4,0]]),
  points([[B,H],[B+del4,H]]),
  vector([B+del4,0],[0,H]),
  points_joined = false,
  label_orientation = 'vertical,
label(["H",B+del2,H/2]),
   /*  p_a  */
   color = black,
  label_orientation = 'horizontal,
  head_both = false,
  line_type = solid,
  head_length = 0.2,
head_angle = 10,
  color = black,
vector([2.5,(H+del3)],[0,del3]),
  label(["p_a",2.50.5+del3,H+del3]),
    /* Epura  */
line_width=1,color=blue,line_type = solid,
fill_color = lightblue,
poly:polygon([[1,0],[1,H],[pi(0)/scale_p1,0],[01,0]]),
head_length = 0.3,
head_angle = 10,
color = blue,
line_width=2,
   head_both = false,
vector([pi(dh·0)/scale_p1,H5·dh],[pi(dh·0)/scale_p,0]),
vector([pi(dh·1)/scale_p1,H4·dh],[pi(dh·1)/scale_p,0]),
vector([pi(dh·2)/scale_p1,H3·dh],[pi(dh·2)/scale_p,0]),
vector([pi(dh·3)/scale_p1,H2·dh],[pi(dh·3)/scale_p,0]),
vector([pi(dh·4)/scale_p1,H1·dh],[pi(dh·4)/scale_p,0]),
    transparent = true,
   line_width=1,
   color = black,
   points_joined = true,
   point_size=0.1,
  points([[2,0],[1,0],[1,H+del2]]),
   line_width=2,color=blue,
   water:points([[2,H],[1,H]]),
   color = red,
label(["Px",1del4,h_D_+del2]),
label([hh,1+del2,h_D_+del1]),
   line_type = solid,
head_length = 0.3,
head_angle = 15,
line_width=2,
   point_type = filled_circle,
   point_size=1,
   vector([1P/(scale·2),h_D_],[P/(scale·2),0]),
  points([[1,h_D_]]),
   points([[B/2,h_D_]]),
   label_orientation = 'horizontal,
label(["D",B/2+del1,h_D_]),
   /*  h_D  */
   color=black,line_width=1,
  head_both = true,
  head_length = 0.2,
  head_angle = 10,
    vector([1+del2,0],[0,h_D_]),
  points_joined = false,
  label_orientation = 'vertical,
label(["h_D_",del2,h_D_/2]),
   points_joined = true,
   point_size=0.1,
  points([[1,h_D_],[1+del3,h_D_]]),
   /* copy right  */
   color = "#0e406e",
label_orientation = 'vertical,
label(["www.k123.org.ua ",3·B1,H/2]),
  label(["Kopanytsia Y (c)  2025",3·B0.5,H/2]),
   /*  Results  */
   color = "#0e406e",
/*   rectangle([0,y_draw-del4],[x_draw,y_draw]), */
  label_orientation = 'horizontal,
label([hh,x_draw/2,y_drawdel3]),
   label(["h_D [m]",x_draw/2,y_drawdel1/2]),
   label([pp,x_drawdel4,y_drawdel3]),
   label(["P [N]",x_drawdel4,y_drawdel1/2])
/*    key = "Force",
xtics_secondary = true,
   ytics_secondary = true,
   xaxis_secondary = true,
   yaxis_secondary = true,
   xlabel_secondary="P[N]",
   ylabel_secondary="p[Pa]",
    yrange_secondary=[-49050.0,2/5*49050.0],
   xrange_secondary=[-P,P] */
)$
--> P;P/scale;

\[\]\[\tag{%o36} 44145.0\]

\[\]\[\tag{%o37} 4.4145\]

Figure 1:
Diagram
Figure 2:D:\j_Iam_TEMP\_jh\jh_k123_Rectangle_v1_1.svg
Diagram
--> H2·dh;H;dh;

\[\]\[\tag{%o40} 4.2\]

\[\]\[\tag{%o41} 7\]

\[\]\[\tag{%o42} 1.4\]

Var 2 (down)
--> 'integrate(ro·g·((Hh)·h)·B,h,0,H);

\[\]\[\tag{%o43} 29430.0 \int \left( 7\mathop{-}h\right) h{\, dh}\]

--> mP_down:integrate(ro·g·((Hh)·h)·B,h,0,H);

\[\]\[\tag{%o44} 1682415.0\]

--> h_D_down:mP_down/P;

\[\]\[\tag{%o45} 2.3333333333333335\]

Задача. Визначити силу тиску на плоску
прямокутну поверхню шириною B=3 м та
висотою H=7 м. На вільній поверхні рідини
атмосферний тиск . Прошарок води h1=1 м.

Rectangle with h1
(%i37) kill(all);

\[\]\[\tag{%o0} \ensuremath{\mathrm{done}}\]

(%i5) ro:1000;g:9.81;H:7;B:3;p_m:10000;

\[\]\[\tag{%o1} 1000\]

\[\]\[\tag{%o2} 9.81\]

\[\]\[\tag{%o3} 7\]

\[\]\[\tag{%o4} 3\]

\[\]\[\tag{%o5} 10000\]

(%i6) h1:1;

\[\]\[\tag{%o6} 1\]

(%i11) del1:H/15,numer;del2:H/10,numer;del3:H/7,numer; del4:H/5,numer;del5:H/3,numer;

\[\]\[\tag{%o7} 0.4666666666666667\]

\[\]\[\tag{%o8} 0.7\]

\[\]\[\tag{%o9} 1\]

\[\]\[\tag{%o10} 1.4\]

\[\]\[\tag{%o11} 2.3333333333333335\]

(%i12) dh:H/5,numer;

\[\]\[\tag{%o12} 1.4\]

(%i14) 'integrate((ro·g·(Hh+h1))·B,h,0,H);integrate((ro·g·(Hh+h1))·B,h);

\[\]\[\tag{%o13} 49050.0 \int_{0}^{7}9\mathop{-}h{\, dh}\]

\[\]\[\tag{%o14} 49050.0 \left( 9 h\mathop{-}\frac{{{h}^{2}}}{2}\right) \]

(%i15) pi(h):=9810.0·(Hh+h1);

\[\]\[\tag{%o15} \mathop{pi}(h)\mathop{:=}9810.0 \left( H\mathop{-}h\mathop{+}\ensuremath{\mathrm{h1}}\right) \]

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

\[\]\[\tag{%o16} 1888425.0\]

(%i17) if P_h1<10 then scale:3 elseif P_h1<100 then scale:20
   elseif P_h1<1000 then scale:200
   elseif P_h1<10000 then scale:2000
   elseif P_h1<100000 then scale:20000
   elseif P_h1<1000000 then scale:200000
   elseif P_h1<10000000 then scale:2000000
   ;

\[\]\[\tag{%o17} 2000000\]

(%i20) pi(0);pi(0)/scale;pi(h1)/scale;

\[\]\[\tag{%o18} 88290.0\]

\[\]\[\tag{%o19} 0.044145\]

\[\]\[\tag{%o20} 0.034335\]

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

\[\]\[\tag{%o21} 1.178835 {{10}^{7}}\]

(%i22) h_D_h1:mP_h1/P_h1;

\[\]\[\tag{%o22} 6.242424242424242\]

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

\[\]\[\tag{%o23} 5207475.0\]

(%i24) h_D_h1_down:mP_h1_down/P_h1;

\[\]\[\tag{%o24} 2.757575757575758\]

test rectangle + h1
(%i25) h_D_h1+h_D_h1_down;

\[\]\[\tag{%o25} 9.0\]

(%i27) x_draw:3·B;y_draw:H+h1+2;

\[\]\[\tag{%o26} 15\]

\[\]\[\tag{%o27} 11\]

(%i29) n: h_D_h1_down;mod(n,1);

\[\]\[\tag{%o28} 2.757575757575758\]

\[\]\[\tag{%o29} 0.7575757575757578\]

(%i30) if floor(n·100)/100>0 then n:floor(n·100)/100 elseif floor(n·1000)/1000>0 then n:floor(n·1000)/1000;

\[\]\[\tag{%o30} \frac{11}{4}\]

(%i31) n:n,numer;

\[\]\[\tag{%o31} 2.75\]

(%i32) hh:sconcat(n);

\[\]\[\tag{%o32} "2.75"\]

(%i33) pp:sconcat(P_h1);

\[\]\[\tag{%o33} "1888425.0"\]

(%i35) scale_p:pi(0)/2;scale;

\[\]\[\tag{%o34} 44145.0\]

\[\]\[\tag{%o35} 2000000\]

(%i36) draw2d(xrange = [5,x_draw],
yrange = [0,y_draw],
  font      = "Arial",
           font_size = 16,
title="Rectangle",
   xlabel = "Presure, Pa",
ylabel = "h,m",
  grid = true,
  proportional_axes=xy,
  line_type = solid,
   color = black,
  fill_color = "#cccccc",
line_width=2,
rectangle([0,0],[B,H]),
  line_width=2,color=blue,
   water:polygon([[3,H+h1],[1,H+h1]]),
water:polygon([[0,H+h1],[B,H+h1]]),
   color=black,line_width=1,
  head_both = true,
  head_length = 0.2,
  head_angle = 10,
vector([0,H+h1+del1],[B,0]),
  label(["B",B/2,H+h1+del3]),
    points_joined = true,
   point_size=0.1,
  points([[0,H+h1],[0,H+h1+del2]]),
  points([[B,H+h1],[B,H+h1+del2]]),
  points([[B,0],[B+del4,0]]),
  points([[B,H],[B+del4,H]]),
  vector([B+del4,0],[0,H]),
   points([[B,H+h1],[B+del4,H+h1]]),
  vector([B+del4,H],[0,h1]),
   line_width=2,
   points([[0,0],[0,H+del1/2+h1]]),
  points([[B,0],[B,H+del1/2+h1]]),
  points_joined = false,
  label_orientation = 'vertical,
label(["H",B+del2,H/2]),
   label(["h1",B+del2,(H+h1/2)]),
   /*  p_a  */
  color = black,
  label_orientation = 'horizontal,
  head_both = false,
  line_type = solid,
  head_length = 0.2,
head_angle = 10,
  color = black,
vector([2.5,(H+h1+del3)],[0,del3]),
  label(["p_a",2.50.5+del3,H+h1+del3]),
    /* Epura  */
  line_width=1,color=blue,line_type = dashes,
fill_color = white,
poly:polygon([[1,0],[1,H+h1],[pi(0)/scale_p1,0],[01,0]]),
   line_type = solid,
   fill_color = lightblue,
poly:polygon([[1,0],[1,H],[pi(H)/scale_p1,H],[pi(0)/scale_p1,0],[01,0]]),
head_length = 0.3,
head_angle = 10,
color = blue,
line_width=2,
   head_both = false,
vector([pi(dh·0)/scale_p1,H5·dh],[pi(dh·0)/scale_p,0]),
vector([pi(dh·1)/scale_p1,H4·dh],[pi(dh·1)/scale_p,0]),
vector([pi(dh·2)/scale_p1,H3·dh],[pi(dh·2)/scale_p,0]),
vector([pi(dh·3)/scale_p1,H2·dh],[pi(dh·3)/scale_p,0]),
vector([pi(dh·4)/scale_p1,H1·dh],[pi(dh·4)/scale_p,0]),
    transparent = true,
   line_width=2,
   color = black,
   points_joined = true,
   point_size=0.1,
  points([[2,0],[1,0],[1,H+h1+del1/2]]),
   line_width=2,color=blue,
  color = red,
label(["Px",1del4,h_D_h1_down+del2]),
label([hh,1+del2,h_D_h1_down+del1]),
   line_type = solid,
head_length = 0.3,
head_angle = 15,
line_width=2,
   point_type = filled_circle,
   point_size=1,
   vector([1P_h1/(scale·2),h_D_h1_down],[P_h1/(scale·2),0]),
  points([[1,h_D_h1_down]]),
   points([[B/2,h_D_h1_down]]),
   label_orientation = 'horizontal,
label(["D",B/2+del1,h_D_h1_down]),
   /*  h_D_h1_down  */
   color=black,line_width=1,
  head_both = true,
  head_length = 0.2,
  head_angle = 10,
    vector([1+del2,0],[0,h_D_h1_down]),
  points_joined = false,
  label_orientation = 'vertical,
label(["h_D_",del2,h_D_h1_down/2]),
   points_joined = true,
   point_size=0.1,
  points([[1,h_D_h1_down],[1+del3,h_D_h1_down]]),
   /* copy right  */
   color = "#0e406e",
label_orientation = 'vertical,
label(["www.k123.org.ua ",3·B1,H/2]),
  label(["Kopanytsia Y (c)  2025",3·B0.5,H/2]),
   /*  Results  */
   color = "#0e406e",
  rectangle([x_draw/3,y_drawdel4],[x_draw,y_draw]),
  label_orientation = 'horizontal,
label([hh,x_draw/2,y_drawdel3]),
   label(["h_D [m]",x_draw/2,y_drawdel1/2]),
   label([pp,x_drawdel4,y_drawdel3]),
   label(["P [N]",x_drawdel4,y_drawdel1/2])
/*    key = "Force",
xtics_secondary = true,
   ytics_secondary = true,
   xaxis_secondary = true,
   yaxis_secondary = true,
   xlabel_secondary="P[N]",
   ylabel_secondary="p[Pa]",
    yrange_secondary=[-49050.0,2/5*49050.0],
   xrange_secondary=[-P,P] */
)$;
Figure 3:
Diagram
Figure 4:D:\j_Iam_TEMP\_jh\jh_k123_Rectangle_v1_2.svg
Diagram

Triangle

-----------Triangle-------------
(%i13) H:4;

\[\]\[\tag{%o13} 4\]

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

\[\]\[\tag{%o14} \mathop{fB}(h)\mathop{:=}\frac{B}{H} \left( H\mathop{-}h\right) \]

(%i16) fB(0);fB(H);

\[\]\[\tag{%o15} 3\]

\[\]\[\tag{%o16} 0\]

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

\[\]\[\tag{%o17} 156960.0\]

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

\[\]\[\tag{%o18} 470880.0\]

(%i19) h_D_tri:mP_tri/P_tri;

\[\]\[\tag{%o19} 3.0\]

(%i20) h_D_tri_down:Hh_D_tri;

\[\]\[\tag{%o20} 1.0\]

Trapetion
--> P_trap:integrate(ro·g·(Hh)·fB(h),h,0,H/2);

\[\]\[\tag{%o59} 91560.0\]

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

\[\]\[\tag{%o60} 294300.0\]

--> h_D_trap:mP_trap/P_trap;

\[\]\[\tag{%o61} 3.2142857142857144\]

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

\[\]\[\tag{%o62} 71940.0\]

--> h_D_trap_down:mP_trap_down/P_trap;

\[\]\[\tag{%o63} 0.7857142857142857\]

Circle UP half
--> R:1;

\[\]\[\tag{%o64} 1\]

--> fB_circle(h):=2·sqrt(R··2h··2);

\[\]\[\tag{%o65} \mathop{fB\_ circle}(h)\mathop{:=}2 \sqrt{{{R}^{2}}\mathop{-}{{h}^{2}}}\]

--> fB_circle(0);fB_circle(R);

\[\]\[\tag{%o66} 2\]

\[\]\[\tag{%o67} 0\]

--> P_cir_up:integrate(ro·g·(Rh)·fB_circle(h),h,0,R);

\[\]\[\tag{%o68} 19620.0 \left( \frac{\pi }{4}\mathop{-}\frac{1}{3}\right) \]

--> P_cir_up,numer;

\[\]\[\tag{%o69} 8869.511965857935\]

--> mP_cir_up:integrate(ro·g·((Rh)··2)·fB_circle(h),h,0,R);

\[\]\[\tag{%o70} 19620.0 \left( \frac{5 \pi }{16}\mathop{-}\frac{2}{3}\right) \]

--> h_D_cir_up:mP_cir_up/P_cir_up,numer;

\[\]\[\tag{%o71} 0.6969819738807302\]

test
--> h_c:(10.4244)·R;p:ro·g·h_c;w:(%pi·(R··2))/2;P:p·w,numer;I:0.1098·R··4;

\[\]\[\tag{%o72} 0.5756\]

\[\]\[\tag{%o73} 5646.636\]

\[\]\[\tag{%o74} \frac{\pi }{2}\]

\[\]\[\tag{%o75} 8869.715087547827\]

\[\]\[\tag{%o76} 0.1098\]

--> h_D:h_c+I/(h_c·w),numer;

\[\]\[\tag{%o77} 0.6970399774252266\]


Created with wxMaxima.

The source of this Maxima session can be downloaded here.