механіка лабораторная 101

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
Program errorLab101;
const
tpn = 2.78;
tp = 2;
p = 0.95;
m_bar = 60.132;
m_cylinder = 19.653;
f = 24.8;
j = 24.828;
type
inputs = array[0..4, 0..4] of real;
results = array[0..4, 0..6] of real;
var
x1, x2, x3, x4, x5,
x_avg, S_x, S_x_avg,
random_error_x, marg_error,
error_instrum_x,
round_error_x,
sum_error_x,
ro_avg_abc, ro_avg_dh, abs_ro_abc, abs_ro_dh, ro_abc, ro_dh: real;
x: inputs;
res: results;
i: integer;
function h(s: real): real;
var i: integer;
begin
i := 0;
h := 1;
while i < 10 do begin
if frac(s) > 0 then begin
s := s * 10;
i := i + 1;
h *= 0.1;
end else break;
end;
end;
begin
x[0][0] := 24.8;
x[0][1] := 24.9;
x[0][2] := 24.82;
x[0][3] := 24.8;
x[0][4] := 24.82;
x[1][0] := 39.44;
x[1][1] := 39.6;
x[1][2] := 39.44;
x[1][3] := 39.8;
x[1][4] := 39.44;
x[2][0] := 7.6;
x[2][1] := 8;
x[2][2] := 7.68;
x[2][3] := 8;
x[2][4] := 7.6;
x[3][0] := 15.9;
x[3][1] := 15.91;
x[3][2] := 15.93;
x[3][3] := 15.9;
x[3][4] := 15.9;
x[4][0] := 13.6;
x[4][1] := 13.13;
x[4][2] := 13.63;
x[4][3] := 13.64;
x[4][4] := 13.63;
for i := 0 to 4 do begin
x1 := x[i][0];
x2 := x[i][1];
x3 := x[i][2];
x4 := x[i][3];
x5 := x[i][4];
if i < 3 then
marg_error := 0.02
else
marg_error := 0.01;
x_avg := (x1 + x2 + x3 + x4 + x5) / 5;
S_x := sqrt((sqr(x1 - x_avg) + sqr(x2 - x_avg) + sqr(x3 - x_avg) + sqr(x4 - x_avg) + sqr(x5 - x_avg)) / 4);
S_x_avg := S_x / sqrt(5);
random_error_x := tpn * S_x_avg;
error_instrum_x := tp * (marg_error / 3);
round_error_x := p * h(x1) / 2;
sum_error_x := sqrt(sqr(random_error_x) + sqr(error_instrum_x) + sqr(round_error_x));
writeln('i = ', i + 1);
writeln('seredne znachennya = ', x_avg:5:3);
writeln('vidhilennya zesultatu sposteregen = ', S_x:5:3);
writeln('vidhilennya serednogo arifmetichnogo = ', S_x_avg:5:3);
writeln('vipadkova pohibka = ', random_error_x:5:3);
writeln('pohibka priladu = ', error_instrum_x:5:3);
writeln('pohibka okruglennya = ', round_error_x:5:3);
writeln('sumarna absolutna pohibka = ', sum_error_x:5:3);
writeln();
res[i][0] := x_avg;
res[i][1] := S_x;
res[i][2] := S_x_avg;
res[i][3] := random_error_x;
res[i][4] := error_instrum_x;
res[i][5] := round_error_x;
res[i][6] := sum_error_x;
end;
ro_avg_abc := m_bar / (res[0][0] * res[1][0] * res[2][0]);
ro_avg_dh := (4 * m_cylinder) / (Pi * sqr(res[3][0]) * res[4][0]);
abs_ro_abc := ro_avg_abc * sqrt(sqr(res[0][6]) + sqr(res[1][6]) + sqr(res[2][6]));
abs_ro_dh := ro_avg_dh * sqrt(sqr(2 * res[3][6]) + sqr(res[4][6]));
ro_abc := abs_ro_abc / ro_avg_abc;
ro_dh := abs_ro_dh / ro_avg_dh;
writeln('ro bar = ', ro_avg_abc:8:6);
writeln('ro cylinder = ', ro_avg_dh:8:6);
writeln('absolutna ro abc = ', abs_ro_abc:5:3);
writeln('absolutna ro bh = ', abs_ro_dh:5:3);
writeln('ro abc = ', ro_abc:5:3);
writeln('ro dh = ', ro_dh:5:3);
end.