\( \DeclareMathOperator{\abs}{abs} \newcommand{\ensuremath}[1]{\mbox{$#1$}} \)
Умова
| (%i1) | kill(all); |
\[\]\[\tag{%o0} \ensuremath{\mathrm{done}}\]
| (%i1) | load(draw)$ |
| (%i7) | ro:1000;g:9.81;H:2;B:3;Hmn:1;n:1000; |
\[\]\[\tag{%o2} 1000\]
\[\]\[\tag{%o3} 9.81\]
\[\]\[\tag{%o4} 2\]
\[\]\[\tag{%o5} 3\]
\[\]\[\tag{%o6} 1\]
\[\]\[\tag{%o7} 1000\]
| (%i12) | fh(x):=x··2;fHab(x):=Hmn;fH(x):=H;Fx(h):=sqrt(h);diff(Fx(h),h); |
\[\]\[\tag{%o8} \mathop{fh}(x)\mathop{:=}{{x}^{2}}\]
\[\]\[\tag{%o9} \mathop{fHab}(x)\mathop{:=}\ensuremath{\mathrm{Hmn}}\]
\[\]\[\tag{%o10} \mathop{fH}(x)\mathop{:=}H\]
\[\]\[\tag{%o11} \mathop{Fx}(h)\mathop{:=}\sqrt{h}\]
\[\]\[\tag{%o12} \frac{1}{2 \sqrt{h}}\]
| (%i13) | dh(h):=1/(2·sqrt(h)); |
\[\]\[\tag{%o13} \mathop{dh}(h)\mathop{:=}\frac{1}{2 \sqrt{h}}\]
| (%i14) | plot2d([fh(x),fHab(x),fH(x)],[x,0,2]); |
\[\]\[\tag{%o14} false\]

| (%i15) | plot2d(Fx(h),[h,0,H], [color,black],[style, [lines, 5,5]]); |
\[\]\[\tag{%o15} false\]

| (%i16) | fp(h):=ro·g·(H−h); |
\[\]\[\tag{%o16} \mathop{fp}(h)\mathop{:=}\ensuremath{\mathrm{ro}} g\, \left( H\mathop{-}h\right) \]
P_x - горизонтальна проекція сили тиску
| (%i17) | P_x:integrate(fp(h)·B,h,0,Hmn); |
\[\]\[\tag{%o17} 44145.0\]
| (%i18) | mP_x:integrate(fp(h)·(H−h)·B·h,h,0,Hmn); |
\[\]\[\tag{%o18} 26977.5\]
| (%i19) | mP_x_down:integrate(fp(h)·B·h,h,0,Hmn); |
\[\]\[\tag{%o19} 19620.0\]
| (%i20) | h_D:mP_x/P_x; |
\[\]\[\tag{%o20} 0.6111111111111112\]
| (%i21) | h_D_:mP_x_down/P_x; |
\[\]\[\tag{%o21} 0.4444444444444444\]
| (%i22) | h_D+h_D_; |
\[\]\[\tag{%o22} 1.0555555555555556\]

P_x - чисельний алгоритм методу К123
| (%i25) | P_x_sum:0;dh:Hmn/n;h:0; |
\[\]\[\tag{%o23} 0\]
\[\]\[\tag{%o24} \frac{1}{1000}\]
\[\]\[\tag{%o25} 0\]
| (%i26) | Pi_x(h):=ro·g·(H−h)·B; |
\[\]\[\tag{%o26} \mathop{Pi\_ x}(h)\mathop{:=}\ensuremath{\mathrm{ro}} g\, \left( H\mathop{-}h\right) B\]
| (%i28) | for i:1 while h < Hmn do (Pi:Pi_x(h)·dh,P_x_sum:P_x_sum+Pi,h:h+dh);P_x_:P_x_sum; |
\[\]\[\tag{%o27} \ensuremath{\mathrm{done}}\]
\[\]\[\tag{%o28} 44159.71499999999\]
| (%i29) | Px_test:integrate(Pi_x(hi),hi,0,Hmn); |
\[\]\[\tag{%o29} 44145.0\]
| (%i32) | mP_x_sum:0;dh:Hmn/n;h:0; |
\[\]\[\tag{%o30} 0\]
\[\]\[\tag{%o31} \frac{1}{1000}\]
\[\]\[\tag{%o32} 0\]
| (%i34) | for i:1 while h < Hmn do (Pi:Pi_x(h)·dh·h,mP_x_sum:mP_x_sum+Pi,h:h+dh);mP_x_:mP_x_sum; |
\[\]\[\tag{%o33} \ensuremath{\mathrm{done}}\]
\[\]\[\tag{%o34} 19605.280095000024\]
| (%i35) | kill(h); |
\[\]\[\tag{%o35} \ensuremath{\mathrm{done}}\]
| (%i36) | mPx_test:integrate(Pi_x(h)·(h),h,0,Hmn); |
\[\]\[\tag{%o36} 19620.0\]
| (%i38) | h_D:mP_x_sum/P_x_sum;h_D_test:mPx_test/Px_test; |
\[\]\[\tag{%o37} 0.44396301232922425\]
\[\]\[\tag{%o38} 0.4444444444444444\]
| (%i39) | Rel_ERROR:(100/h_D_test)·(h_D_test−h_D),numer; |
\[\]\[\tag{%o39} 0.10832222592453838\]
P_z - вертикальна проекція сили тиску
| (%i40) | kill(h); |
\[\]\[\tag{%o40} \ensuremath{\mathrm{done}}\]
| (%i45) | ro:1000;g:9.81;H:2;B:3;Hmn:1; |
\[\]\[\tag{%o41} 1000\]
\[\]\[\tag{%o42} 9.81\]
\[\]\[\tag{%o43} 2\]
\[\]\[\tag{%o44} 3\]
\[\]\[\tag{%o45} 1\]
| (%i46) | P_z:integrate(fp(h)·B·dh(h),h,0,Hmn); |
\[\]\[\tag{%o46} 49050.0\]
| (%i47) | mP_z:integrate(fp(h)·B·dh(h)·(Fx(h)),h,0,Hmn); |
\[\]\[\tag{%o47} 22072.5\]
| (%i48) | x_C:mP_z/P_z; |
\[\]\[\tag{%o48} 0.45\]

P_z - чисельний алгоритм методу К123
| (%i53) | ro:1000;g:9.81;H:2;B:3;Hmn:1; |
\[\]\[\tag{%o49} 1000\]
\[\]\[\tag{%o50} 9.81\]
\[\]\[\tag{%o51} 2\]
\[\]\[\tag{%o52} 3\]
\[\]\[\tag{%o53} 1\]
| (%i56) | P_z_sum:0;dh:Hmn/n;h:0; |
\[\]\[\tag{%o54} 0\]
\[\]\[\tag{%o55} \frac{1}{1000}\]
\[\]\[\tag{%o56} 0\]
| (%i58) | fB(i,dh):=sqrt(i·dh); fB(1,dh),numer; |
\[\]\[\tag{%o57} \mathop{fB}\left( i\mathop{,}\ensuremath{\mathrm{dh}}\right) \mathop{:=}\sqrt{i\, \ensuremath{\mathrm{dh}}}\]
\[\]\[\tag{%o58} 0.03162277660168379\]
| (%i60) | Pi_x(h):=ro·g·(H−h)·B; Pi_x(0.2); |
\[\]\[\tag{%o59} \mathop{Pi\_ x}(h)\mathop{:=}\ensuremath{\mathrm{ro}} g\, \left( H\mathop{-}h\right) B\]
\[\]\[\tag{%o60} 52974.0\]
| (%i62) | fdb(i,dh):=(fB((i+1),dh)−fB((i),dh))/dh;fdb(1000,dh),numer; |
\[\]\[\tag{%o61} \mathop{fdb}\left( i\mathop{,}\ensuremath{\mathrm{dh}}\right) \mathop{:=}\frac{\mathop{fB}\left( i\mathop{+}1\mathop{,}\ensuremath{\mathrm{dh}}\right) \mathop{-}\mathop{fB}\left( i\mathop{,}\ensuremath{\mathrm{dh}}\right) }{\ensuremath{\mathrm{dh}}}\]
\[\]\[\tag{%o62} 0.4998750624609638\]
| (%i63) | for i: 0 while h < Hmn do (db:fdb(i,dh),Pi:Pi_x(h)·db·dh,P_z_sum:P_z_sum+Pi,h:h+dh)$ |
| (%i65) | P_z_:P_z_sum,numer;h; |
\[\]\[\tag{%o64} 49064.52275520602\]
\[\]\[\tag{%o65} 1\]
| (%i68) | mP_z_sum:0;dh:Hmn/n;h:0; |
\[\]\[\tag{%o66} 0\]
\[\]\[\tag{%o67} \frac{1}{1000}\]
\[\]\[\tag{%o68} 0\]
| (%i69) | for i: 0 while h < Hmn do (db:fdb(i,dh),Pi:Pi_x(h)·db·dh·fB(i,dh),mP_z_sum:mP_z_sum+Pi,h:h+dh)$ |
| (%i71) | mP_z_:mP_z_sum,numer;h; |
\[\]\[\tag{%o70} 22003.335303355238\]
\[\]\[\tag{%o71} 1\]
| (%i73) | x_C_:mP_z_/P_z_,numer; x_C; |
\[\]\[\tag{%o72} 0.44845713496765977\]
\[\]\[\tag{%o73} 0.45\]
| (%i74) | Rel_ERROR:(100/x_C)·(x_C−x_C_),numer; |
\[\]\[\tag{%o74} 0.3428588960756102\]
P - Сила гідростатичного тиску
| (%i76) | P_x;P_z; |
\[\]\[\tag{%o75} 44145.0\]
\[\]\[\tag{%o76} 49050.0\]
| (%i77) | P:sqrt(P_x··2+P_z··2); |
\[\]\[\tag{%o77} 65990.02595089655\]
| (%i78) | phi_rad:atan(P_z/P_x),numer; |
\[\]\[\tag{%o78} 0.83798122500839\]
| (%i79) | phi_grad:atan(P_z/P_x)·(180/%pi),numer; |
\[\]\[\tag{%o79} 48.01278750418334\]
| (%i80) | d:tan(P_z/P_x); |
\[\]\[\tag{%o80} 2.0199703317182265\]
| (%i81) | k:P_z/P_x; |
\[\]\[\tag{%o81} 1.1111111111111112\]
| (%i82) | scale:100000; |
\[\]\[\tag{%o82} 100000\]
| (%i85) | P_xv:P_x/scale;P_zv:P_z/scale;Pv:P/scale; |
\[\]\[\tag{%o83} 0.44145\]
\[\]\[\tag{%o84} 0.4905\]
\[\]\[\tag{%o85} 0.6599002595089656\]
| (%i86) | kill(D); |
\[\]\[\tag{%o86} \ensuremath{\mathrm{done}}\]
| (%i90) | h_D;x_C;phi_rad;k; |
\[\]\[\tag{%o87} 0.44396301232922425\]
\[\]\[\tag{%o88} 0.45\]
\[\]\[\tag{%o89} 0.83798122500839\]
\[\]\[\tag{%o90} 1.1111111111111112\]
| (%i91) | eq:h_D=−k·x_C+D; |
\[\]\[\tag{%o91} 0.44396301232922425\mathop{=}D\mathop{-}0.5\]
| (%i92) | solve(eq,D); |
\[\]\[rat: replaced 0.9439630123292242 by 2832833/3001000 = 0.9439630123292236\]
\[\]\[\tag{%o92} \left[ D\mathop{=}\frac{2832833}{3001000}\right] \]
| (%i93) | D:2832833/3001000,numer; |
\[\]\[\tag{%o93} 0.9439630123292236\]
| (%i94) | y(x):=−k·x+D; |
\[\]\[\tag{%o94} \mathop{y}(x)\mathop{:=}\mathop{-}k x\mathop{+}D\]
| (%i95) | y(0.45); |
\[\]\[\tag{%o95} 0.44396301232922364\]
| (%i96) | y1(x):=x··2; |
\[\]\[\tag{%o96} \mathop{y1}(x)\mathop{:=}{{x}^{2}}\]
| (%i97) | eq1:−k·x+D=x··2; |
\[\]\[\tag{%o97} 0.9439630123292236\mathop{-}1.1111111111111112 x\mathop{=}{{x}^{2}}\]
| (%i98) | solutions:solve([eq1],[x]); |
\[\]\[rat: replaced 0.9439630123292236 by 2832833/3001000 = 0.9439630123292236 \]\[rat: replaced -1.1111111111111112 by -10/9 = -1.1111111111111112\]
\[\]\[\tag{%o98} \]
| (%i99) | xvals: map(rhs, solutions); |
\[\]\[\tag{%o99} \]
| (%i100) | x_coord:xvals[2],numer; |
\[\]\[\tag{%o100} 0.5636428127589562\]
| (%i101) | h_coord:y1(x_coord); |
\[\]\[\tag{%o101} 0.3176932203748278\]
| (%i103) | xx:x_coord−P_xv;hh:h_coord+P_zv; |
\[\]\[\tag{%o102} 0.12219281275895622\]
\[\]\[\tag{%o103} 0.8081932203748278\]
| (%i104) |
plot2d([y1(x),y(x),[discrete,[x_coord],[h_coord]], [discrete,[x_coord,xx],[h_coord,hh]], [discrete,[x_coord,xx],[h_coord,h_coord]], [discrete,[x_coord,x_coord],[h_coord,hh]], [discrete,[0,2],[2,2]]],[x,0,2.1],[y,0,2.1], [style, [lines, 5,5], [lines, 3,1], [points, 5,2],[lines, 3,2],[lines, 3,2],[lines, 3,2], [lines, 3,1]]); |
\[\]\[plot2d: some values will be clipped. \]\[plot2d: some values will be clipped.\]
\[\]\[\tag{%o104} false\]

Draw
| --> | /* y = 1-1-4 */ |
| (%i105) | fv(y):=(2−0.25·y)/2; |
\[\]\[\tag{%o105} \mathop{fv}(y)\mathop{:=}\frac{2\mathop{-}0.25 y}{2}\]
| (%i126) |
draw2d(xrange = [−1.1,4], yrange = [0,2.5], font = "Arial", font_size = 16, title="Parabola", grid = true, proportional_axes=xy, /* vertical W */ fill_color = lightblue, Wall:polygon([[0,0],[0,2],[1,2],[1,1],[0.75,0.75··2],[0.5,0.5··2],[0.25,0.25··2],[0,0]]), W:polygon([[0,0],[0,2]]), W:polygon([[0.25,0.25··2],[0.25,2]]), W:polygon([[0.5,0.5··2],[0.5,2]]), W:polygon([[0.75,0.75··2],[0.75,2]]), W:polygon([[1,1··2],[1,2]]), line_width=4,color=black, explicit(y1(x),x,0,1.44), line_width=4,color=grey, explicit(y1(x),x,1,sqrt(2)), color=red,line_width=1, explicit(y(x),x,0,x_coord), line_width=3,color=blue, poly:polygon([[0,2],[sqrt(2),2]]), color=black,line_width=1, head_both = true, head_length = 0.2, head_angle = 10, vector([2,2.2],[1,0]), label(["B",2.5,2.3]), points_joined = true, points([[2,2],[2,2.3]]), points([[3,2],[3,2.3]]), points([[3,2],[3.3,2]]), points([[3,0],[3,0.3]]), vector([3.3,0],[0,2]), points_joined = false, label_orientation = 'vertical, label(["H",3.2,1]), label_orientation = 'horizontal, head_both = false, line_type = solid, head_length = 0.2, head_angle = 5, color = black, vector([x_C,(2.3)],[0,−0.3]), label(["p_a",x_C+0.2,2+0.2]), line_width=3,color=blue,line_type = dots, poly:polygon([[0,1],[1,1]]), color=black,point_type = filled_circle,point_size = 1.5, points([[0,0],[1,1]]), color=red,point_type = filled_circle, points([[x_coord,h_coord],[x_C,h_D]]), /* color = red, label(["Proection center pressure",x_C+0.7,h_coord]), color = navy, label(["Horizontal proection vector (default)",x_C+1.3,h_D+0.1]), */ color = black, label(["Px",x_C−0.3,h_D+0.1]), label(["(0.56,0.31)",x_C+0.7,h_D−0.1]), /* label_orientation = 'vertical, color = "#654321", label(["Vertical orientation",x_C-0.2,h_D+0.6]), */ label_orientation = 'vertical, label(["Pz",x_C−0.1,h_D+0.4]), line_type = solid, head_length = 0.2, head_angle = 5, color = black, line_width=1.5, vector([x_C,(h_D+P_zv)],[0,−(P_zv)]), vector([x_C−P_xv,h_D],[P_xv,0]), vector([(x_C−P_xv),(h_D+P_zv)],[P_xv,−P_zv]), color = black, fill_color = "#eeeeee", rectangle([2,0],[3,2]), color = black, fill_color = "#cccccc", line_width=4, rectangle([2,0],[3,1]), /* Epura */ line_width=1,color=blue,line_type = short_long_dashes, fill_color = "#ffffff", poly:polygon([[0−0.1,0],[0−0.1,2],[−1−0.1,0],[0−0.1,0]]), line_width=1,color=blue,line_type = solid, fill_color = lightblue, poly:polygon([[0−0.1,0],[0−0.1,1],[−0.5−0.1,1],[−1−0.1,0],[0−0.1,0]]), /* vertical W Wall:polygon([[0,0],[0,2],[1,2],[1,1],[0.75,0.75**2],[0.5,0.5**2],[0.25,0.25**2],[0,0]]), W:polygon([[0,0],[0,2]]), W:polygon([[0.25,0.25**2],[0.25,2]]), W:polygon([[0.5,0.5**2],[0.5,2]]), W:polygon([[0.75,0.75**2],[0.75,2]]), W:polygon([[1,1**2],[1,2]]), */ /* Epura vectors */ line_type = solid, head_length = 0.3, head_angle = 5, color = blue, line_width=3, vector([−fv(0)−0.05,0],[fv(0)−0.05,0]), vector([−fv(1)−0.05,0.25],[fv(1)−0.05,0]), vector([−fv(2)−0.05,0.5],[fv(2)−0.05,0]), vector([−fv(3)−0.05,0.75],[fv(3)−0.05,0]), vector([−fv(4)−0.05,1],[fv(4)−0.05,0]), /* GPL */ font = "Arial", font_size = 16, color = "#0e406e", label_orientation = 'vertical, label(["www.k123.org.ua ",3.5,1.3]), label(["Kopanytsia Y (c) 2025",3.8,1.3]) )$ |

| (%i108) | hh;h_D; |
\[\]\[\tag{%o107} 0.8081932203748278\]
\[\]\[\tag{%o108} 0.44396301232922425\]
-----------------------------
| (%i109) | fh_D(x):=h_D_; |
\[\]\[\tag{%o109} \mathop{fh\_ D}(x)\mathop{:=}\ensuremath{\mathrm{h\_ D\_ }}\]
| (%i110) |
plot2d([fh(x),fHab(x),fH(x),fh_D(x),[discrete,[0.44,0.44],[0,1]], [discrete,[0.44],[0.45]],vector([0.44,0.45],[0,1])],[x,0,1.5], [legend, "parabola","Top_box", "Water", "P_x", "P_z", "point"], [style, [lines, 5,5], lines, [lines, 3,1], lines, lines, [points, 3,2]], [point_type, circle]); |
\[\]\[plot2d: expression evaluates to non-numeric value everywhere in plotting range.\]
\[\]\[\tag{%o110} false\]

Answer
| (%i116) | P_x;P_z;P;h_D_;x_C;phi_grad; |
\[\]\[\tag{%o111} 44145.0\]
\[\]\[\tag{%o112} 49050.0\]
\[\]\[\tag{%o113} 65990.02595089655\]
\[\]\[\tag{%o114} 0.4444444444444444\]
\[\]\[\tag{%o115} 0.45\]
\[\]\[\tag{%o116} 48.01278750418334\]

| (%i119) | P_x/300;P_z/300;P/300; |
\[\]\[\tag{%o117} 147.15\]
\[\]\[\tag{%o118} 163.5\]
\[\]\[\tag{%o119} 219.9667531696552\]
| (%i120) | P_:sqrt(P_x_··2+P_z_··2); |
\[\]\[\tag{%o120} 66010.66445717201\]
REL_ERRORS
| (%i121) | Rel_ERROR_P_x:(100/P_x)·(P_x−P_x_),numer; |
\[\]\[\tag{%o121} \mathop{-}0.033333333333308936\]
| (%i122) | Rel_ERROR_mP_x_:(100/mP_x_down)·(mP_x_down−mP_x_),numer; |
\[\]\[\tag{%o122} 0.0750249999998791\]
| (%i123) | Rel_ERROR_mP_z:(100/mP_z)·(mP_z−mP_z_),numer; |
\[\]\[\tag{%o123} 0.31335234633486214\]
| (%i124) | Rel_ERROR_P_z:(100/P_z)·(P_z−P_z_),numer; |
\[\]\[\tag{%o124} \mathop{-}0.029608063620829527\]
| (%i125) | Rel_ERROR_P:(100/P)·(P−P_),numer; |
\[\]\[\tag{%o125} \mathop{-}0.031275190421675786\]
Created with wxMaxima.
The source of this Maxima session can be downloaded here.