\( \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) | solve([eq1],[x]); |
\[\]\[rat: replaced 0.9439630123292236 by 2832833/3001000 = 0.9439630123292236 \]\[rat: replaced -1.1111111111111112 by -10/9 = -1.1111111111111112\]
\[\]\[\tag{%o98} \left[ x\mathop{=}\mathop{-}\left( \frac{\sqrt{9137579034730}\mathop{+}1500500}{2700900}\right) \mathop{,}x\mathop{=}\frac{\sqrt{9137579034730}\mathop{-}1500500}{2700900}\right] \]
| (%i99) | x_coord:(sqrt(9137579034730)−1500500)/2700900,numer; |
\[\]\[\tag{%o99} 0.5636428127589562\]
| (%i100) | h_coord:y1(x_coord); |
\[\]\[\tag{%o100} 0.3176932203748278\]
| (%i102) | xx:x_coord−P_xv;hh:h_coord+P_zv; |
\[\]\[\tag{%o101} 0.12219281275895622\]
\[\]\[\tag{%o102} 0.8081932203748278\]
| (%i103) |
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{%o103} false\]

Draw
| (%i104) |
draw2d( proportional_axes=xy, line_width=2,color=black, explicit(y1(x),x,0.1,2), color=black,nticks=160, implicit(sin(x·y)=0.1,x,−1,1,y,−1,1), color=blue,nticks=160, parametric(cos(t),sin(t),t,0,2·%pi), color=orange,nticks=160, polar(0.1+0.8·sin(3·t),t,0,%pi), line_width=7,color=blue, poly:polygon([[2,4],[2,6],[4,8],[6,8],[8,6],[8,4],[6,2],[4,2]]), pnts:points([1,3,5,7,9,9,9,9,9,7,5,3,1,1,1,1], [1,1,1,1,1,3,5,7,9,9,9,9,9,7,5,3]), rct:rectangle([1,−2],[6,−7]), ell:ellipse(6,−6,3,2,0,360), diagr:bars([−7,2,1],[−5,5,1],[−3,7,1],[−1,6,1]), line_width=2,color=green, [v1,v2,v3]:[vector([−8,−8],[6,0]), vector([−8,−8],[6,6]),vector([−2,−8],[0,6])], color=blue, text:label(["Diagram",−5,−1], ["Point on multybox",5,−1], ["Vector",−5,−9], ["Rectangle and elips",5,−9]))$ |
\[\]\[rat: replaced -0.1 by -1/10 = -0.1\]

| (%i106) |
draw2d( title="Parabola", grid = true, proportional_axes=xy, line_width=4,color=black, explicit(y1(x),x,0,1.44), color=black,line_width=1, explicit(y(x),x,0,x_coord), line_width=2,color=blue, poly:polygon([[0,2],[1.4,2]]), line_width=2,color=red, poly:polygon([[0,1],[1,1]]), pnts:points([0,1],[0,1]), color=black,fill_color = white, rectangle([−0.02,−0.02],[0.02,0.02]), rectangle([0.98,0.98],[1.02,1.02]) )$ |

| (%i107) |
draw( delay = 1, file_name = "zzz", terminal = 'animated_gif, gr2d(explicit(x^2,x,−1,1)), gr2d(explicit(x^3,x,−1,1)), gr2d(explicit(x^4,x,−1,1))); |
\[\]\[\tag{%o107} \left[ \mathop{gr2d}\left( \ensuremath{\mathrm{explicit}}\right) \mathop{,}\mathop{gr2d}\left( \ensuremath{\mathrm{explicit}}\right) \mathop{,}\mathop{gr2d}\left( \ensuremath{\mathrm{explicit}}\right) \right] \]
| (%i109) |
draw2d(xrange = [0,10], yrange = [0,9], head_length = 0.7, head_angle = 10, vector([1,1],[0,6]), head_angle = 20, vector([2,1],[0,6]), head_angle = 30, vector([3,1],[0,6]), head_angle = 40, vector([4,1],[0,6]), head_angle = 60, vector([5,1],[0,6]), head_angle = 90, vector([6,1],[0,6]), head_angle = 120, vector([7,1],[0,6]), head_angle = 160, vector([8,1],[0,6]), head_angle = 180, vector([9,1],[0,6]) )$ |

| (%i110) |
draw2d(xrange = [0,8], yrange = [0,8], head_length = 0.7, vector([1,1],[6,0]), head_both = true, vector([1,7],[6,0]) )$ |

| (%i111) |
draw2d(xrange = [0,12], yrange = [0,10], head_length = 1, vector([0,1],[5,5]), /* default type */ head_type = 'empty, vector([3,1],[5,5]), head_type = 'nofilled, vector([6,1],[5,5]))$ |

| (%i112) |
draw2d(key_pos = top_left, key = "Sinus", explicit(sin(x),x,0,10), key_pos = top_right, key = "Cosinus", color = red, explicit(cos(x),x,0,10) )$ |

| (%i113) |
draw2d(xrange = [0,10], yrange = [0,10], point_size = 0, points([[5,5]]), color = navy, label(["Horizontal orientation (default)",5,2]), label_orientation = 'vertical, color = "#654321", label(["Vertical orientation",1,5]))$ |

| (%i114) |
draw2d( grid = true, key="x^2, linear scale", color=red, explicit(x^2,x,1,100), xaxis_secondary = true, xtics_secondary = true, logx_secondary = true, key = "x^2, logarithmic x scale", color = blue, explicit(x^2,x,1,100) )$ |

| (%i115) |
draw2d(xrange = [0,10], yrange = [0,10], point_size = 3, point_type = diamant, points([[1,1],[5,1],[9,1]]), point_type = filled_down_triangle, points([[1,2],[5,2],[9,2]]), point_type = asterisk, points([[1,3],[5,3],[9,3]]), point_type = filled_diamant, points([[1,4],[5,4],[9,4]]), point_type = 5, points([[1,5],[5,5],[9,5]]), point_type = 6, points([[1,6],[5,6],[9,6]]), point_type = filled_circle, points([[1,7],[5,7],[9,7]]), point_type = 8, points([[1,8],[5,8],[9,8]]), point_type = filled_diamant, points([[1,9],[5,9],[9,9]]) )$ |

| (%i116) |
draw2d(xrange = [0,10], yrange = [0,4], point_size = 3, point_type = up_triangle, color = blue, points([[1,1],[5,1],[9,1]]), points_joined = true, point_type = square, line_type = dots, points([[1,2],[5,2],[9,2]]), point_type = circle, color = red, line_width = 7, points([[1,3],[5,3],[9,3]]) )$ |

| (%i117) |
draw2d(xrange = [−1,6], yrange = [−1,6], head_length = 0.1, vector([0,0],[5,2]), unit_vectors = true, color = red, vector([0,3],[5,2]))$ |

| (%i118) |
draw2d( xaxis =true, xaxis_type=solid, yaxis =true, yaxis_type=solid, user_preamble="set grid front", region(x^2+y^2<1 ,x,−1.5,1.5,y,−1.5,1.5))$ |

| (%i119) |
draw2d( key = "Bottom x-axis", explicit(x+1,x,1,2), color = red, key = "Above x-axis", xtics_secondary = true, xaxis_secondary = true, explicit(x^2,x,−1,1)) $ |

| (%i120) |
draw2d(explicit(x^3,x,−1,1), xaxis = true, xaxis_width = 3)$ |

| (%i121) |
draw2d( xaxis_secondary=true,yaxis_secondary=true, xtics_secondary=true,ytics_secondary=true, xlabel_secondary="t[s]", ylabel_secondary="U[V]", explicit(sin(t),t,0,10) )$ |

| (%i122) |
draw2d(yrange = [0.1,1.4], color = red, label(["Label in red",0,0.3]), color = "#0000ff", label(["Label in blue",0,0.6]), color = light_blue, label(["Label in light-blue",0,0.9], ["Another light-blue",0,1.2]) )$ |

| (%i123) |
draw2d(key = "Small points", points(makelist([random(20),random(50)],k,1,10)), point_type = circle, point_size = 3, points_joined = true, key = "Great points", points(makelist(k,k,1,20),makelist(random(30),k,1,20)), point_type = filled_down_triangle, key = "Automatic abscissas", color = red, points([2,12,8]))$ |

| (%i124) |
draw3d(color = cyan, vector([0,0,0],[1,1,1]/sqrt(3)), vector([0,0,0],[1,−1,0]/sqrt(2)), vector([0,0,0],[1,1,−2]/sqrt(6)) )$ |

| (%i125) | load(worldmap)$ |
| (%i126) |
/* A continent */ make_poly_continent(Europe)$ |
| (%i127) | apply(draw2d, %)$ |

| (%i128) | staircase(cos(y), 1, 11, [y, 0, 1.2]); |
\[\]\[\tag{%o128} false\]

-------------------------------------------
| (%i129) | fh_D(x):=h_D_; |
\[\]\[\tag{%o129} \mathop{fh\_ D}(x)\mathop{:=}\ensuremath{\mathrm{h\_ D\_ }}\]
| (%i130) |
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{%o130} false\]

Answer
| (%i136) | P_x;P_z;P;h_D_;x_C;phi_grad; |
\[\]\[\tag{%o131} 44145.0\]
\[\]\[\tag{%o132} 49050.0\]
\[\]\[\tag{%o133} 65990.02595089655\]
\[\]\[\tag{%o134} 0.4444444444444444\]
\[\]\[\tag{%o135} 0.45\]
\[\]\[\tag{%o136} 48.01278750418334\]

| (%i139) | P_x/300;P_z/300;P/300; |
\[\]\[\tag{%o137} 147.15\]
\[\]\[\tag{%o138} 163.5\]
\[\]\[\tag{%o139} 219.9667531696552\]
| (%i140) | P_:sqrt(P_x_··2+P_z_··2); |
\[\]\[\tag{%o140} 66010.66445717201\]
REL_ERRORS
| (%i141) | Rel_ERROR_P_x:(100/P_x)·(P_x−P_x_),numer; |
\[\]\[\tag{%o141} \mathop{-}0.033333333333308936\]
| (%i142) | Rel_ERROR_mP_x_:(100/mP_x_down)·(mP_x_down−mP_x_),numer; |
\[\]\[\tag{%o142} 0.0750249999998791\]
| (%i143) | Rel_ERROR_mP_z:(100/mP_z)·(mP_z−mP_z_),numer; |
\[\]\[\tag{%o143} 0.31335234633486214\]
| (%i144) | Rel_ERROR_P_z:(100/P_z)·(P_z−P_z_),numer; |
\[\]\[\tag{%o144} \mathop{-}0.029608063620829527\]
| (%i145) | Rel_ERROR_P:(100/P)·(P−P_),numer; |
\[\]\[\tag{%o145} \mathop{-}0.031275190421675786\]
Created with wxMaxima.
The source of this Maxima session can be downloaded here.