file D:\_j_knuba_2026\jMAXIMA\jh_Job_ex08_v2.wxmx
TEST OBJECT OF single operations of the K123
Умова. Визначити параметри вектору сили гідростатичного тиску на вертикальну прямокутну поверхню висотою H=3м та шириною B=1м.
Тиск на вільній поверхні рідини атмосферний.
Побудувати епюру гідростатичного тиску та позначити координату центру тиску (крапка D).
Figure 1:
Diagram
(%i1) kill(all);

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

(%i1) load("draw")$
(%i5) long_x:7; label_left:3; label_vert:1.5; label_URL:0.2;

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

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

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

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

(%i13) ro:1000;g:9.81;x0:0;y0:0;x1:0;y1:3;B:1;h1:0;

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

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

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

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

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

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

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

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

(%i15) Hall:y1+h1;H:y1y0;

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

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

VARIANT # 1 (standart)

P_x

(%i18) h_C:(HallH/2);w:H·B;I:(B·H··3)/12;

\[\]\[\tag{%o16} \frac{3}{2}\]

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

\[\]\[\tag{%o18} \frac{9}{4}\]

(%i19) p:ro·g·h_C;

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

(%i20) P:p·w;

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

(%i22) h_D:h_C+(I)/(h_C·w),numer;h_D_:Hallh_D;

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

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

size plot2d - x1
(%i23) x1_:x1x0+long_x;

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

scale
(%i25) scale_L:P;scale_P:P/scale_L;

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

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

(%i26) scale_P:P/scale_L;

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

Draw
(%i38) h1;Hall;H;x1;h_D_;h_D;scale_P;scale_P_z;scale_P_x;P;P_x;P_z;

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

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

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

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

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

\[\]\[\tag{%o32} 2.0\]

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

\[\]\[\tag{%o34} {{\ensuremath{\mathrm{scale\_ P}}}_z}\]

\[\]\[\tag{%o35} {{\ensuremath{\mathrm{scale\_ P}}}_x}\]

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

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

\[\]\[\tag{%o38} {P_z}\]

--> /* Definition of a block with local variables  */;
(%i39) ds(r) := block([x, n],
   n:100,
x:r·n,
   x:floor(x),
   x:x/100,
return(x)
)$
(%i43) h_C:ds(h_C),numer; w:ds(w),numer; I:ds(I),numer;p:ds(p),numer;

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

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

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

\[\]\[\tag{%o43} 14715\]

(%i45) P:ds(P),numer; hi_D_:ds(h_D_),numer;

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

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

(%i46) H2:y1+h1+3;

\[\]\[\tag{%o46} 6\]

epura
(%i47) b:(2/Hall)·(Hall0.1·y1);

\[\]\[\tag{%o47} 1.8\]

(%i49) (2/Hall)·(Hall1·y1);y1;

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

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

(%i50) if h1 < 2 then Hall_add:Hall+5 else Hall_add:Hall;

\[\]\[\tag{%o50} 8\]

(%i54) x1_;Hall;Hall_add;x_left:2;

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

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

\[\]\[\tag{%o53} 8\]

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

(%i59) draw2d(
   xrange = [x_left,x1_], /* size picture  x - x1 & y - H1 */
yrange = [0,Hall_add],
   proportional_axes=xy,
   font      = "Arial",
   font_size = 16,
   grid = true,
   line_width=1,
   color=black,
title = "TEST OBJECT OF single operations of the K123",
      line_width=8,
      line_type = solid,
   points_joined = true,
   color=red,
     points([[x0,y0],[x1,y1],[x2,y1]]), /* inclined flat surface */
   line_width=1,
   color=black,
    line_type = dashes,
   points_joined = true,
    fill_color = white,
     polygon([[2,0],[0,Hall],[0,y0],[2,0]]),
   line_width=4,
      line_type = solid,
   points_joined = true,
   color=red,
   points([[x0,y0],[x1,y1],[x1,Hall]]),/* inclined flat surface */
   line_width=1,
   color=black,
    line_type = dashes,
   points_joined = true,
    fill_color = white,
     polygon([[2,0],[0,Hall],[0,y0],[2,0]]), /* rectangle epura of presure P_x */
   fill_color = gray90,
    line_type = solid,
     polygon([[2,0],[(2/Hall)·(Hall1·y1),y1],[0,y1],[0,0],[2,0]]), /* rectangle epura of presure P_x */
    /* Epura  */
   color = "blue",
   line_width=1,
   line_type = solid,
   head_angle = 10,
   head_length = 0.15,
   vector([(2/Hall)·(Hall0.1·y1),0.1·y1],[(2/Hall)·(Hall0.1·y1),0]), /* horizontal presure vector p  */
   vector([(2/Hall)·(Hall0.2·y1),0.2·y1],[(2/Hall)·(Hall0.2·y1),0]), /* horizontal presure vector p  */
   vector([(2/Hall)·(Hall0.3·y1),0.3·y1],[(2/Hall)·(Hall0.3·y1),0]), /* horizontal presure vector p  */
   vector([(2/Hall)·(Hall0.4·y1),0.4·y1],[(2/Hall)·(Hall0.4·y1),0]), /* horizontal presure vector p  */
   vector([(2/Hall)·(Hall0.5·y1),0.5·y1],[(2/Hall)·(Hall0.5·y1),0]), /* horizontal presure vector p  */
   vector([(2/Hall)·(Hall0.6·y1),0.6·y1],[(2/Hall)·(Hall0.6·y1),0]), /* horizontal presure vector p  */
   vector([(2/Hall)·(Hall0.7·y1),0.7·y1],[(2/Hall)·(Hall0.7·y1),0]), /* horizontal presure vector p  */
   vector([(2/Hall)·(Hall0.8·y1),0.8·y1],[(2/Hall)·(Hall0.8·y1),0]), /* horizontal presure vector p  */
   vector([(2/Hall)·(Hall0.9·y1),0.9·y1],[(2/Hall)·(Hall0.9·y1),0]), /* horizontal presure vector p  */  
    color = "black",
fill_color = light_blue,
   line_width=2,
   head_angle = 15,
   head_length = 0.25,
   color=black,point_type = filled_circle,
  point_size = 1.5,
  points_joined = false,
  points([[0,h_D_]]),
    label_orientation = horizontal,
label(["P",x00.5,h_D_+0.5]), /* point P */
   line_width=1,
   line_type = dashes,
   head_angle = 180,
   vector([1,h_D_],[3·y1,0]), /* horizontal line dot to vector P  */
   color = "blue",
   line_width=3,
   line_type = solid,
   head_angle = 15,
   head_length = 0.25,
   vector([x01,h_D_],[+scale_P,0]), /* horizontal vector P  */
   font      = "Arial",
   font_size = 16,
  color = "#0e406e",
   label_orientation = horizontal,
label(["www.k123.org.ua ", x1_long_x/2,Hall_addlabel_URL]),
  label(["Kopanytsia Y (c)  2026", x1_long_x/2,Hall_add3·label_URL]),
   label_orientation = horizontal,
   label_alignment = left,
color = black,
    label([concat("h_{C}=: ", string(h_C)," m"), x1_label_left, y1·2]),
   label([concat("w=: ", string(w)," m"), x1_label_left, y1·1.8]),
   label([concat("p=: ", string(p)," Pa"), x1_label_left, y1·1.6]),
   label([concat("I=: ", string(I)," m"), x1_label_left, y1·1.4]),
    label([concat("h_D_{coord}=: ", string(hi_D_)," m"), x1_label_left, y1·1.2]),
   label([concat("P=: ", string(P)," N"), x1_label_left, y1·0.8]),
   line_type = solid,
  color=black,line_width=1,
  head_both = true,
  head_length = 0.2,
  head_angle = 10,
   vector([x1+scale_P+0.1,0],[0,h_D_]), /* h_D_ */
  label_alignment = center,
   label_orientation = vertical,
   font_size = 10,
label([concat("h_{D_{coord}}=: ", string(hi_D_)," m"), x1+0.7, h_D_·0.6]),
   /* Input data */
line_type = solid,
  color=blue,
   line_width=3,
   head_angle = 180,
  vector([x_left,Hall],[x_left,0]), /* horizontal line dot to vector P_x  */
   line_width=1,
   line_type = dashes,
   head_angle = 180,
   vector([x0,y1],[x_left,0]), /* horizontal line dot size H  */
   line_type = solid,
  color=black,
   line_width=1,
   line_type = solid,
  head_both = true,
  head_length = 0.2,
  head_angle = 10,
   vector([x1+x_left0.2,0],[0,y1]), /* vertical line size H */
   label_alignment = center,
   label_orientation = vertical,
   font_size = 10,
label([concat("H=: ", string(Hall)," m"), x1+x_left0.5, Hall·0.6]), /* vertical  size H */
line_type = solid,
  color=black,
   line_width=1,
   line_type = solid,
  head_both = false,
  head_length = 0.2,
  head_angle = 10,
   vector([x0x_left/2,y1+0.4],[0,0.4]), /* vector p_a */
    font      = "Times-Italic",
   font_size = 16,
  color = "#0e406e",
   label_orientation = horizontal,
label(["p_{a} ", x0x_left/20.4,y1+0.4]),
   label(["D ", x0+0.3,hi_D_0.1])
);

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

Figure 2:
Diagram

Created with wxMaxima.

The source of this Maxima session can be downloaded here.