D:\j_Iam_TEMP\_jh\_jh_ex2b_3a_v6.wxmx

# Умова

Визначити силу гідростатичного тиску на бокову грань "MN" параболоїдального каналу висотою Hmn = 1
метр та шириною B = 3 метри. Рівень води у каналі H = 2 метри.
Аналітичні та чисельні розрахунки методом K123.

D:\j_Iam_TEMP\_jh\_jh_ex2b_3a_v1_F1.svg

kill(all);

load(draw)$

ro:1000;g:9.81;H:2;B:3;Hmn:1;n:1000;

fh(x):=x**2;fHab(x):=Hmn;fH(x):=H;Fx(h):=sqrt(h);diff(Fx(h),h);

dh(h):=1/(2*sqrt(h));

Fx(1);

del1:Hmn/10,numer;del2:Hmn/5,numer;del3:Hmn/3,numer;

del4:Hmn/2.5,numer;del5:Hmn/2,numer;

line_w:1;

draw2d(xrange = [-1.1,4.5],
yrange = [0,2.5],
    font      = "Arial",
             font_size = 16,
title="Parabola",
    grid = true,
    proportional_axes=xy,
  line_width=4,color=black,
explicit(fh(x),x,0,Fx(H)+del1),
    line_width=4,color=grey,
explicit(fh(x),x,Hmn,Fx(H)),
    line_type = solid,
     line_width=3,color=blue,
water:polygon([[0,H],[Fx(H),H]]),
    line_width=3,color=blue,line_type = dots,
water_hm:polygon([[0,Hmn],[Fx(Hmn),Hmn]]),
    line_type = solid,
    color=black,line_width=1,
    head_both = true,
    head_length = 0.2,
    head_angle = 10,
vector([H,H+del2],[1,0]),
    label(["B",2.5,H+del3]),
    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,Hmn]),
    points_joined = true,
   points([[Fx(Hmn),Hmn],[Fx(Hmn)+1,Hmn]]),
     points([[Fx(Hmn),0],[Fx(Hmn)+1,0]]),
    vector([Fx(Hmn)+0.7,0],[0,Hmn]),
       points_joined = false,
  label(["Hmn",1+0.5,Hmn/2]),
    color = black,
    label_orientation = 'horizontal,
    head_both = false,
    line_type = solid,
    head_length = 0.2,
head_angle = 5,
    color = black,
vector([0.5,(H+del3)],[0,-0.3]),
    label(["p_a",0.5+0.3,2+0.2]),
       color = black, fill_color = "#eeeeee",
rectangle([2,0],[3,2]),
   color = black,
    fill_color = "#cccccc",
   line_width=4,
rectangle([2,0],[3,1]),
             /*  GPL */
 font      = "Arial",
             font_size = 16,
    color = "#0e406e",
 label_orientation = 'vertical,
label(["www.k123.org.ua ",4,1.3]),
    label(["Kopanytsia Y (c)  2025",4.3,1.3]),
    color=black,point_type = filled_circle,
    point_size = 2,
    points_joined = false,
points([[0,0]]),
    label_orientation = 'horizontal,
    label(["M",0-del2,0+del1]),
    points([[Hmn,Fx(Hmn)]]),
    label(["N",Hmn+del2,Fx(Hmn)])
)$

D:\j_Iam_TEMP\_jh\_jh_ex2b_3a_v2_F1.svg

plot2d([fh(x),fHab(x),fH(x)],[x,0,H]);

D:\j_Iam_TEMP\_jh\_jh_ex2b_3a_v2_F2.svg

plot2d(Fx(h),[h,0,H], [color,black],[style, [lines, 5,5]]);

D:\j_Iam_TEMP\_jh\_jh_ex2b_3a_v2_F3.svg

fp(h):=ro*g*(H-h);

Standart

h_C_st:H-Hmn/2,numer;

p_c_st:ro*g*h_C_st;

w_st:B*Hmn;

P_x_st:p_c_st*w_st;

I:(B*Hmn**3)/12,numer;

h_D_st:h_C_st+(I)/(h_C_st*w_st);

h_D_down_st:H-h_D_st;

# P_x - горизонтальна проекція сили тиску

 scale:100000; 

P_x:integrate(fp(h)*B,h,0,Hmn);

mP_x:integrate(fp(h)*B*(H-h),h,0,Hmn);

mP_x_down:integrate(fp(h)*B*h,h,0,Hmn);

h_D:mP_x/P_x;

h_D_:mP_x_down/P_x;

h_D+h_D_;

 fv(y):=(2−0.25·y)/2; 

fv(0);fv(1);fv(2);

equestion

integrate(ro_*g_*(H_-h)*B_,h,0,Hmn_);

P_plot(B_,x,H_):=-(4905.0*B_*(Hmn_^2-2*H_*Hmn_));

P_plot(3,3,4);

P_plot_(ro_,g_,B_,Hmn_,H_):=(-((B_*(Hmn_^2-2*H_*Hmn_)*g_*ro_)/2));

P_plot_(1000,9.81,3,1,2);

integrate(ro*g*(H_-h)*B*h,h,0,Hmn_);

mP_plot(x,H_):=-(4905.0*(2*x^3-3*H_*x^2));

integrate(ro_*g_*(H_-h_)*B_*h_,h_,0,Hmn_);

tex(-((B_*(2*Hmn_^3-3*H_*Hmn_^2)*g_*ro_)/6),false);

mP_plot_(ro_,g_,B_,Hmn_,H_):=(-(((2*Hmn_^3-3*H_*Hmn_^2)*g_*ro_)/2));

h_plot_D_(x,H_):=(-(4905.0*(2*x^3-3*H_*x^2)))/(-(14715.0*(x^2-2*H_*x)));

rat((-(4905.0*(2*x^3-3*H_*x^2)))/(-(14715.0*(x^2-2*H_*x))));

h_plot_D(x,H_):=(2*x^2-3*H_*x)/(3*x-6*H_);

h_plot_D(3,4),numer;

h_D_plot_(ro_,g_,B_,Hmn_,H_):=(-(((2*Hmn_^3-3*H_*Hmn_^2)*g_*ro_)/2))/((-((B_*(Hmn_^2-2*H_*Hmn_)*g_*ro_)/2)));

rat((-(((2*Hmn_^3-3*H_*Hmn_^2)*g_*ro_)/2))/(-((B_*(Hmn_^2-2*H_*Hmn_)*g_*ro_)/2)));

_h_D_plot_(ro_,g_,B_,Hmn_,H_):=((2*Hmn_^2-3*H_*Hmn_)/(B_*Hmn_-2*B_*H_));

_h_D_plot_(1000,9.81,3,1,2),numer;

tex((2*Hmn_^2-3*H_*Hmn_)/(B_*Hmn_-2*B_*H_), false);

Numer method

Ps:0;mPs:0;ni:10000;dhi:Hmn/ni;

for i:1 thru ni step 1 do (Psi:ro*g*(H-dhi*i)*B*dhi,Ps:Ps+Psi)$

for i:1 thru ni step 1 do (mPsi:ro*g*(H-dhi*i)*(dhi*i)*B*dhi,mPs:mPs+mPsi)$

Ps;mPs;h_D_downi:mPs/Ps;

---- The end NM

P_xv:P_x/scale;

draw2d(xrange = [-1.1,4.5],
yrange = [0,3],
    font      = "Arial",
             font_size = 16,
title="Parabola",
    grid = true,
    proportional_axes=xy,
  line_width=4,color=black,
explicit(fh(x),x,0,Fx(H)+del1),
    line_width=4,color=grey,
explicit(fh(x),x,Hmn,Fx(H)),
    line_type = solid,
     line_width=3,color=blue,
water:polygon([[0,H],[Fx(H),H]]),
    line_width=3,color=blue,line_type = dots,
water_hm:polygon([[0,Hmn],[Fx(Hmn),Hmn]]),
    line_type = solid,
    color=black,line_width=1,
    head_both = true,
    head_length = 0.2,
    head_angle = 10,
vector([H,H+del2],[1,0]),
    label(["B",2.5,H+del3]),
    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,Hmn]),
    points_joined = true,
   points([[Fx(Hmn),Hmn],[Fx(Hmn)+1,Hmn]]),
     points([[Fx(Hmn),0],[Fx(Hmn)+1,0]]),
    vector([Fx(Hmn)+0.7,0],[0,Hmn]),
       points_joined = false,
  label(["Hmn",1+0.5,Hmn/2]),
    color = black,
    label_orientation = 'horizontal,
    head_both = false,
    line_type = solid,
    head_length = 0.2,
head_angle = 5,
    color = black,
vector([0.5,(H+del3)],[0,-del3]),
    label(["p_a",0.5+del3,H+del2]),
       color = black, fill_color = "#eeeeee",
rectangle([2,0],[3,2]),
   color = black,
    fill_color = "#cccccc",
   line_width=4,
rectangle([2,0],[3,1]),
             /*  GPL */
 font      = "Arial",
             font_size = 16,
    color = "#0e406e",
 label_orientation = 'vertical,
label(["www.k123.org.ua ",4,1.3]),
    label(["Kopanytsia Y (c)  2025",4.3,1.3]),
    color=black,point_type = filled_circle,
    point_size = 2,
    points_joined = false,
points([[0,0]]),
    label_orientation = 'horizontal,
    label(["M",0-del2,0+del1]),
    points([[Hmn,Fx(Hmn)]]),
    label(["N",Hmn+del2,Fx(Hmn)]),
     /* 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]]),
    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]),       
    color = red,
   label(["Px",0,h_D_+del2]),
   label(["0.44",0-0.8,h_D_]),
    line_type = solid,
   head_length = 0.2,
head_angle = 5,
   line_width=2,
vector([0−P_xv-del1,h_D_],[P_xv,0]),
    points([[0-del1,h_D_]]),
  points_joined = true,
    line_width=0.5,
    point_size    = 0.1,
   points([[-1,h_D_],[4,h_D_]]),
    points([[2.5,0],[2.5,H]]),
    label_orientation = 'vertical,
    head_both = true,
    line_type = solid,
    head_length = 0.2,
head_angle = 5,
    vector([1,h_D_],[0,-h_D_]),
    label(["h_D",1-del2,h_D_/2]),
 /* label_orientation = 'horizontal,
  label(["h_D = 0.56 m, P_x=44145.0 N",2,Hmn+del3]), */
    fill_color  = white,
    rectangle([0,3-del4],[4,3]),
    label_orientation = 'vertical,
    head_both = true,
    line_type = solid,
    head_length = 0.2,
head_angle = 5,
 label_orientation = 'horizontal,
 label(["h_D = 0.44 m, P_x=44145.0",2,3-del2])
   )$

h_D;P_x;

D:\j_Iam_TEMP\_jh\_jh_ex2b_3a_v6_1.svg

D:\j_Iam_TEMP\_jh\_jh_ex2_P_x.jpg

# P_x - чисельний алгоритм методу К123

P_x_sum:0;dh:Hmn/n;h:0;

 Pi_x(h):=ro·g·(H−h)·B; 

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;

 Px_test:integrate(Pi_x(hi),hi,0,Hmn); 

mP_x_sum:0;dh:Hmn/n;h:0;

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;

kill(h);

 mPx_test:integrate(Pi_x(h)·(h),h,0,Hmn); 

 h_D:mP_x_sum/P_x_sum;h_D_test:mPx_test/Px_test; 

Rel_ERROR:(100/h_D_test)·(h_D_test−h_D),numer; 

# P_z - вертикальна проекція сили тиску

kill(h);

ro:1000;g:9.81;H:2;B:3;Hmn:1;

P_z:integrate(fp(h)*B*dh(h),h,0,Hmn);

mP_z:integrate(fp(h)*B*dh(h)*(Fx(h)),h,0,Hmn);

x_C:mP_z/P_z;

integrate(ro_*g_*(H_-h_)*B_*(1/(2*sqrt(h_))),h_,0,Hmn_);

Pz(ro_,g_,B_,Hmn_,H_):=-((B_*sqrt(Hmn_)*(2*Hmn_-6*H_)*g_*ro_)/6);

Pz(1000,9.81,3,1,2);

integrate(ro_*g_*(H_-h_)*B_*(1/(2*sqrt(h_)))*sqrt(h_),h_,0,Hmn_);

mPz(ro_,g_,B_,Hmn_,H_):=-((B_*(Hmn_^2-2*H_*Hmn_)*g_*ro_)/4);

fx_C(ro_,g_,B_,Hmn_,H_):=(-((B_*(Hmn_^2-2*H_*Hmn_)*g_*ro_)/4))/(-((B_*sqrt(Hmn_)*(2*Hmn_-6*H_)*g_*ro_)/6));

rat((-((B_*(Hmn_^2-2*H_*Hmn_)*g_*ro_)/4))/(-((B_*sqrt(Hmn_)*(2*Hmn_-6*H_)*g_*ro_)/6)));

x_C(ro_,g_,B_,Hmn_,H_):=((3*Hmn_^2-6*H_*Hmn_)/(4*sqrt(Hmn_)*Hmn_-12*H_*sqrt(Hmn_)));

x_C(1000,9.81,3,1,2),numer;

dh(h);Fx(h);

D:\j_Iam_TEMP\_jh\_jh_ex2_P_z.jpg

P_zv:P_z/scale;

ytop=3;

draw2d(xrange = [-1.1,4.5],
yrange = [0,3],
    font      = "Arial",
             font_size = 16,
title="Parabola",
    grid = true,
    proportional_axes=xy,
     /*   vertical W */
    line_width=0.5,
    color=blue,
    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]]),
    /*   -- the end W  */
  line_width=4,color=black,
explicit(fh(x),x,0,Fx(H)+del1),
    line_width=4,color=grey,
explicit(fh(x),x,Hmn,Fx(H)),
    line_type = solid,
     line_width=3,color=blue,
water:polygon([[0,H],[Fx(H),H]]),
    line_width=3,color=blue,line_type = dots,
water_hm:polygon([[0,Hmn],[Fx(Hmn),Hmn]]),
    line_type = solid,
    color=black,line_width=1,
    head_both = true,
    head_length = 0.2,
    head_angle = 10,
vector([H,H+del2],[1,0]),
    label(["B",2.5,H+del3]),
    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,Hmn]),
    points_joined = true,
   points([[Fx(Hmn),Hmn],[Fx(Hmn)+1,Hmn]]),
     points([[Fx(Hmn),0],[Fx(Hmn)+1,0]]),
    vector([Fx(Hmn)+0.7,0],[0,Hmn]),
       points_joined = false,
  label(["Hmn",1+0.5,Hmn/2]),
    color = black,
    label_orientation = 'horizontal,
    head_both = false,
    line_type = solid,
    head_length = 0.2,
head_angle = 5,
    color = black,
vector([0.8,(H+del3)],[0,-del3]),
    label(["p_a",0.8+del3,H+del2]),
       color = black, fill_color = "#eeeeee",
rectangle([2,0],[3,2]),
   color = black,
    fill_color = "#cccccc",
   line_width=4,
rectangle([2,0],[3,1]),
             /*  GPL */
 font      = "Arial",
             font_size = 16,
    color = "#0e406e",
 label_orientation = 'vertical,
label(["www.k123.org.ua ",4,1.3]),
    label(["Kopanytsia Y (c)  2025",4.3,1.3]),
    color=black,point_type = filled_circle,
    point_size = 2,
    points_joined = false,
points([[0,0]]),
    label_orientation = 'horizontal,
    label(["M",0-del2,0+del1]),
    points([[Hmn,Fx(Hmn)]]),
    label(["N",Hmn+del2,Fx(Hmn)]),
     /* 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]]),
    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]),       
    color = red,
   label(["Px",0,h_D+del2]),
   label(["0.56",0-0.8,h_D]),
    line_type = solid,
   head_length = 0.2,
head_angle = 5,
   line_width=2,
vector([0−P_xv-del1,h_D],[P_xv,0]), 
    points([[0-del1,h_D]]),
  points_joined = true,
    line_width=0.5,
    point_size    = 0.1,
   points([[-1,h_D],[4,h_D]]),
    points([[2.5,0],[2.5,H]]), 
    label_orientation = 'vertical,
    head_both = true,
    line_type = solid,
    head_length = 0.2,
head_angle = 5,
    vector([1,h_D],[0,-h_D]),
    label(["h_D",1-del2,h_D/2]),   */
   /* label_orientation = 'vertical,
color = "#654321",
label(["Vertical orientation",x_C-0.2,h_D+0.6]), */
   label_orientation = 'vertical,
     color = red,
label(["Pz",x_C−0.1,h_D+0.4]),
   line_type = solid,
   head_length = 0.2,
head_angle = 5,
  line_width=1.5,
    vector([x_C,(h_D+P_zv)],[0,−(P_zv)]),
   label_orientation = 'horizontal,
     color = red,
   line_type = solid,
   line_width=1,
    head_both = true,
    head_length = 0.2,
    head_angle = 10,
vector([0,H+del2],[x_C,0]),
    label(["x_C",x_C/2,H+del3+del1]),
    points_joined = true,
    point_size = 0.1,
    line_type = solid,
    points([[0,H],[0,H+del3]]),
    line_type = dashes,
    points([[x_C,0],[x_C,H+del3]]),
    fill_color  = white,
    rectangle([0,3-del4],[4,3]),
    label_orientation = 'vertical,
    head_both = true,
    line_type = solid,
    head_length = 0.2,
head_angle = 5,
 label_orientation = 'horizontal,
 label(["x_C = 0.45 m, P_z=49050.0 N",2,3-del2]),
    label(["0.45",x_C,del1])
)$

x_C;P_z;

D:\j_Iam_TEMP\_jh\_jh_ex2b_3a_v2_F5.svg

# P_z - чисельний алгоритм методу К123

ro:1000;g:9.81;H:2;B:3;Hmn:1;

P_z_sum:0;dh:Hmn/n;h:0;

coordinate - x {for h=i*dh x=sqrt(h)}

 fB(i,dh):=sqrt(i·dh); fB(1,dh),numer;

Pi_x(h):=ro·g·(H−h)·B; Pi_x(0.2);

fdb(i,dh):=(fB((i+1),dh)−fB((i),dh))/dh;fdb(1000,dh),numer;

 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)$ 

P_z_:P_z_sum,numer;h;

FOR MOMENT P_z coordinate - x {for h=i*dh x=sqrt(h)}

mP_z_sum:0;dh:Hmn/n;h:0;

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)$ 

mP_z_:mP_z_sum,numer;h;

 x_C_:mP_z_/P_z_,numer; x_C;

Rel_ERROR:(100/x_C)·(x_C−x_C_),numer; 

# P - Сила гідростатичного тиску

P_x;P_z;

P:sqrt(P_x**2+P_z**2);

phi_rad:atan(P_z/P_x),numer;

phi_grad:atan(P_z/P_x)*(180/%pi),numer;

d:tan(P_z/P_x);

k:P_z/P_x;

Проекції вектора сили й координати (Projections of the force vector and coordinates)

scale:100000;

P_xv:P_x/scale;P_zv:P_z/scale;Pv:P/scale;

kill(D);

h_D;x_C;phi_rad;k;

eq:h_D=-k*x_C+D;

Di:h_D+k*x_C;

solve(eq,D);

D:2832833/3001000,numer;

y(x):=-k*x+D;

y(0.45);

y1(x):=x**2;

eq1:-k*x+D=x**2;

solutions:solve([eq1],[x]);

xvals: map(rhs, solutions);

x_coord:xvals[2],numer;

h_coord:y1(x_coord);

xx:x_coord-P_xv;hh:h_coord+P_zv;

Numer method

f1(x):=-k*x+Di;f2(x):=x**2;h1:0;h2:0;ni:1000;x1:0;x2:sqrt(Hmn);xi:x2/ni;j:0;

 Di;f1(xi*1000),numer;f2(xi*1000),numer;

for j: 1 while f1(xi*j)-f2(xi*j)>0 do (j: j+1,x2:xi*j);

x2,numer;

--------- the end NM

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]]);

D:\j_Iam_TEMP\_jh\_jh_ex2b_3a_v2_F6.svg

# Draw

/*  y = 1-1-4 */;

fv(y):=(2-0.25*y)/2;

draw 4 x 3.5

draw2d(xrange = [-1.1,4],
yrange = [0,3.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([Fx(H)*2/3,(H+del3)],[0,-0.3]),
    label(["p_a",Fx(H)*2/3+del3,H+del2]),
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 = red,
    label(["(0.56,0.31)",x_C+del5+del2,h_D-del1]),
    label(["(0.45,0.44)",x_C+del5,h_D+del1]),
    color = black,
    label(["Px",x_C-0.3,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]]),  */
    color = black, fill_color  = "#cccccc",
rectangle([-0.1,0],[-0.05,1]),
    /*  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]),
      /*  Angle "phi" 
    color = black, fill_color  = "#eeeeee",
     line_width=0.5,
     head_angle  = 180,
    vector([h_D,x_C],[-P_x/45000,P_z/45000]),
    vector([h_D-P_x/45000,x_C+P_z/45000],[0.5,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]),
    fill_color  = white,
    rectangle([0,3.5-del5*2],[4,3.5]),
    label_orientation = 'vertical,
    head_both = true,
    line_type = solid,
    head_length = 0.2,
head_angle = 5,
 label_orientation = 'horizontal,
 label(["x_C = 0.45 m, P_z=49050.0 N;",2,3.5-del5]),
label(["h_D = 0.44 m, P_x=44145.0 N;",2,3.5-del2]),
    label(["x = 0.56 m, y=0.31 m, P=65990 N.",2,3.5-del3-del5]),
    label(["0.45",x_C,del1])
)$

P;

h_D;x_C;x_C-P_x/40000;h_D+P_x/40000;

x_coord;h_coord;

D:\j_Iam_TEMP\_jh\_jh_ex2b_3a_v2_F7.svg

hh;h_D;

# -----------------------------

Plot2d

fh_D(x):=h_D_;

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]);

D:\j_Iam_TEMP\_jh\_jh_ex2b_3a_v2_F8.svg

eq:y=x_C;plot2d([fh(x),fHab(x),fH(x),fh_D(x),eq],[x,0,2],[y,0,4]);

# Answer

P_x;P_z;P;h_D_;x_C;x_coord;h_coord;phi_grad;

D:\j_Iam_TEMP\_jh\_jh_ex2.jpg

Scale screen 300 px

P_x/300;P_z/300;P/300;

P_:sqrt(P_x_**2+P_z_**2);

# REL_ERRORS

Rel_ERROR_P_x:(100/P_x)·(P_x−P_x_),numer; 

Rel_ERROR_mP_x_:(100/mP_x_down)·(mP_x_down−mP_x_),numer;

Rel_ERROR_mP_z:(100/mP_z)·(mP_z−mP_z_),numer; 

Rel_ERROR_P_z:(100/P_z)·(P_z−P_z_),numer; 

Rel_ERROR_P:(100/P)·(P−P_),numer;