file D:\_j_knuba_2026\jMAXIMA\jh_Job_ex07_v2.wxmx

Rectangle B:1, triangle,trapetion (Broken Line)

kill(all);

long_x:4; label_left:2.5; label_vert:1.5; label_URL:0.2;

ro:1000;g:9.81;x0:0;y0:0;x1:3;y1:2;x2:3;y2:3;B:1;h1:2;

Hall:y2+h1;H:y2-y0;

# P_x

h_C:(Hall-H/2);w:H*B;I:(B*H**3)/12;

P_x:ro*g*h_C*B;

h_D:h_C+(I)/(h_C*w),numer;h_D_:Hall-h_D;

# P_z

W1:(((x1-x0)*(y1-y0))/2)*B,numer;

W2:((((x1-x0)+(x2-x1))/2)*(y2-y1))*B,numer;

W:W1+W2;P_z:W*ro*g;

P_z1:W1*ro*g; P_z2:W2*ro*g;

mP_z1:W1*ro*g*(1/3*(x1-x0)); mP_z2:W2*ro*g*(1/2*(x1-x0));

if x0 = x1 and x1 =x2 then x_D=0 else x_D:(mP_z1+mP_z2)/(P_z);

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

Phi

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

size plot2d - x1

x1_:x1-x0+long_x;

scale

scale_L:P_x;scale_P_x:P_x/scale_L;

scale_P_z:P_z/scale_L;

scale_P:P/scale_L;

Draw

h1;Hall;H;x1;h_D_;x_D;scale_P;scale_P_z;scale_P_x;P;P_x;P_z;

/* Definition of a block with local variables  */;

ds(r) := block([x, n],
    n:100,
  x:r*n,
    x:floor(x),
    x:x/100,
  return(x)
)$

Pi_x:ds(P_x),numer; Pi_z:ds(P_z),numer; Pi:ds(P),numer; fi_gr:ds(fi_gr),numer; hi_D_:ds(h_D_),numer;xi_D:ds(x_D),numer;

inclined flat surface

x0;x1;y0;y1;h1;

fyL1(y1,x1,x):=(y1/x1)*x;

plot2d(fyL1(y1,x1,x),[x,0,x1]);

x_v:xi_D;y_v:hi_D_;

x0_v:x_v-scale_P_x;y0_v:y_v+scale_P_z;

(y0_v-y_v)/(x_v-x0_v)=(y-y_v)/(x_v-x);

fyV(x_v,y_v,x0_v,y0_v,x):=(x_v-x)*((y0_v-y_v)/(x_v-x0_v))+y_v;

fyV(x_v,y_v,x0_v,y0_v,1);

plot2d(fyV(x_v,y_v,x0_v,y0_v,x),[x,0,x1]);

plot2d([fyV(x_v,y_v,x0_v,y0_v,x),fyL1(y1,x1,x)],[x,0,x1]);

coord_x(n,x_v,y_v,x0_v,y0_v,y1,x1):=block
([dx,xi,yiC,yiL],
    dx:x1/n,
    x_i:dx,
    for i:1 step 1 thru n do (yiL:fyV(x_v,y_v,x0_v,y0_v,x_i),yiC:fyL1(y1,x1,x_i), if yiL>yiC then (x_i:x_i+dx) else (x_i:x_i)),
        return (x_i)
);

x_v;y_v;x0_v;y0_v;y1;x1;

X:coord_x(500,x_v,y_v,x0_v,y0_v,y1,x1),numer;Y:fyL1(y1,x1,X),numer;

Xi:ds(X),numer; Yi:ds(Y),numer; 

H2:y2+h1+3;

x_z:x_v;

epura

b:(2/Hall)*(Hall-0.1*y2);

-(2/Hall)*(Hall-1*y2);y2;

if h1 < 2 then Hall_add:Hall+5 else Hall_add:Hall;

draw2d(
    xrange = [-2,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 = "Pressure force on a cinclined flat surface",
     fill_color = light_blue,
    polygon([[x0,y0],[x1,y1],[x2,y2],[x2,Hall],[x0,Hall],[x0,y0]]), /* rectangle Body of presure */
       line_width=4,
       line_type = solid,
    points_joined = true,
    color=red,
    points([[x0,y0],[x1,y1],[x2,y2]]), /* 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)*(Hall-1*y2),y2],[0,y2],[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)*(Hall-0.1*y2),0.1*y2],[(2/Hall)*(Hall-0.1*y2),0]), /* horizontal presure vector p  */
    vector([-(2/Hall)*(Hall-0.2*y2),0.2*y2],[(2/Hall)*(Hall-0.2*y2),0]), /* horizontal presure vector p  */
    vector([-(2/Hall)*(Hall-0.3*y2),0.3*y2],[(2/Hall)*(Hall-0.3*y2),0]), /* horizontal presure vector p  */
    vector([-(2/Hall)*(Hall-0.4*y2),0.4*y2],[(2/Hall)*(Hall-0.4*y2),0]), /* horizontal presure vector p  */
    vector([-(2/Hall)*(Hall-0.5*y2),0.5*y2],[(2/Hall)*(Hall-0.5*y2),0]), /* horizontal presure vector p  */
    vector([-(2/Hall)*(Hall-0.6*y2),0.6*y2],[(2/Hall)*(Hall-0.6*y2),0]), /* horizontal presure vector p  */
    vector([-(2/Hall)*(Hall-0.7*y2),0.7*y2],[(2/Hall)*(Hall-0.7*y2),0]), /* horizontal presure vector p  */
    vector([-(2/Hall)*(Hall-0.8*y2),0.8*y2],[(2/Hall)*(Hall-0.8*y2),0]), /* horizontal presure vector p  */
    vector([-(2/Hall)*(Hall-0.9*y2),0.9*y2],[(2/Hall)*(Hall-0.9*y2),0]), /* horizontal presure vector p  */   
     color=black,
    fill_color = red,
filled_func = true,
  /*  explicit(fy(x),x,0,R),  1/4 circle  */
    fill_color = light_blue,
    line_width=1,
    head_angle = 180,
vector([0,y1],[x1,0]), /* horizontal line between W1 &W2  */
    color = navy,
label(["W1",x1*0.7,y1-0.2]),
    label(["W2",x1*0.7,H-0.2]),
    label_orientation = vertical,
color = "#654321",
label(["Body presure",x1/2,H-1]),
    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([[x_z,y2]]),  /* point P_z */
    points([[X,Y]]),  /* point P */
    points([[0,h_D_]]), /* point P_x */
    label_orientation = horizontal,
 label(["P_x",x0-0.5,h_D_+0.3]),
    label_orientation = vertical,
    label(["P_z",x_z-0.4,y2+0.9]), 
    line_width=1,
    line_type = dashes,
    head_angle = 180,
    vector([-1,h_D_],[3*y1,0]), /* horizontal line dot to vector P_x  */
    vector([x_z,y2],[0,-y2]),  /* vertical line dot to vector P_z  */
    vector([X,Y],[-1.5*x1,1.5*scale_P_z*x1]),  /* direct angle line dot to vector P  */
    color = "blue",
    line_width=3,
    line_type = solid,
    head_angle = 15,
    head_length = 0.25,
    vector([x0-1,h_D_],[+scale_P_x,0]), /* horizontal vector P_x  */
    vector([x_z,y2+scale_P_z],[0,-scale_P_z]), /* vertical vector P_y  */
    /*  vector([x_z+scale_P_x,h_D_+scale_P_z],[-scale_P_x,-scale_P_z]),  Full vector P  */
    vector([X-scale_P_x,Y+scale_P_z],[+scale_P_x,-scale_P_z]),  /* Full vector P  */
    font      = "Arial",
            font_size = 16,
   color = "#0e406e",
    label_orientation = horizontal,
 label(["www.k123.org.ua ", x1_-long_x/2,Hall_add-label_URL]),
   label(["Kopanytsia Y (c)  2026",  x1_-long_x/2,Hall_add-3*label_URL]), 
    label_orientation = horizontal,
  /* label([string(P_X), x1-0.8, R/2]) */
    label_alignment = left,
color = black,
  label([concat("Y=: ", string(Yi)," m"), x1_-label_left, y1*1.6]),
     label([concat("X=: ", string(Xi)," m"), x1_-label_left, y1*1.4]),
    label([concat("h_D=: ", string(hi_D_)," m"), x1_-label_left, y1*1.2]),
    label([concat("x_z=: ", string(x_z)," m"), x1_-label_left, y1]),
    label([concat("P_x=: ", string(Pi_x)," N"), x1_-label_left, y1*0.8]),
    label([concat("P_z=: ", string(Pi_z)," N"), x1_-label_left, y1*0.6]),
    label([concat("P=: ", string(Pi)," N"), x1_-label_left, y1*0.4]),
    label([concat("phi=: ", string(fi_gr)," grad"), x1_-label_left, y1*0.2]),  
    label([concat("(", string(Xi)," ,", string(Yi)," )"), X+0.1, Y-0.1]), 
    line_type = solid,
   color=black,line_width=1,
   head_both = true,
   head_length = 0.2,
   head_angle = 10,
    vector([x1+scale_P_x,0],[0,h_D_]), /* h_D_ */
    vector([0,y1+0.3],[x_z,0]), /* x_z */
    label_alignment = center,
    label_orientation = vertical,
    font_size = 10,
 label([concat("h_d=: ", string(hi_D_)," m"), x1+0.8, h_D_/2]),
    label_orientation = horizontal,
    label([concat("x_z=: ", string(x_z)," m"), x_z/2,y1+0.5])
);