You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

42 lines
1.8 KiB
Python

2 years ago
from math import *
s = [[float(k) for k in x.split('\t') if k != '--'] for x in '23 176 176 176 176 175 -- -- -- -- -- -- -- -- -- --\n\
30 174 174 175 175 174 175 -- -- -- -- -- -- -- -- --\n\
35 174 174 174 174 174 174 173 173 174 174 174 174 174 173 174\n\
40 172 172 172 172 172 172 172 172 172 172 172 172 172 172 172\n\
45 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171\n\
50 170 170 169 169 170 170 170 169 169 170 170 169 170 170 170\n\
55 169 169 169 169 169 169 169 170 170 169 169 170 170 169 169\n\
60 168 169 168 168 168 168 168 168 169 169 168 168 168 168 168'.split('\n')]
def avg(list_):
m = 0
ms = 0
for v in list_:
m += v
ms += v ** 2
n = len(list_)
m /= n
ms /= n
return (m, ((ms - m ** 2) / (n * (n - 1))) ** 0.5)
dsdt = 112 / 10**6
ddsdt = 8 / 10 ** 6
for line in s:
T = line[0]
p, dp = avg(line[1:])
#print(p, sqrt(dp ** 2 + 0.5 ** 2))
#print(T, '{0:.1f}'.format(p), '{0:.2f}'.format(p * 1.05 / 1000 * 0.2 / 4 * 1000), sep='$&$', end='$\\\\ \\hline\n$')
#print(T, 0.1, p * 9.8 * 1.05 / 1000 * 0.2 / 4 * 1000, p * 9.8 * 1.05 / 1000 * 0.2 / 4 * 1000 * (0.025 / 1.05 + 0.5 / p))
#print(T, 0.1, - T * dsdt * 1000, 1000 * T * dsdt * (ddsdt / dsdt + 0.1 / T))
#print(T, 0.1, )
f = - T * dsdt * 1000
s = p * 9.8 * 1.05 / 1000 * 0.2 / 4 * 1000
df = 1000 * T * dsdt * (ddsdt / dsdt + 0.1 / T)
ds = p * 9.8 * 1.05 / 1000 * 0.2 / 4 * 1000 * (0.025 / 1.05 + 0.5 / p)
#print(T, '{0:.1f}'.format(p), '{0:.0f}'.format(s), sep='$&$', end='$\\\\ \\hline\n$')
#print(T, 0.1, '{0:.1f}'.format(f), '{0:.1f}'.format(df), '{0:.0f}'.format(f + s), '{0:.0f}'.format(df + ds), sep='$&$', end='$\\\\ \\hline\n$')
print(T, 0.1, s - f, ds + df)
#print(T, 0.1, p * 9.8 * 1.05 / 1000 * 0.2 / 4 * 1000 - T * dsdt * 1000, 1000 * T * dsdt * (ddsdt / dsdt + 0.1 / T) + p * 9.8 * 1.05 / 1000 * 0.2 / 4 * 1000 * (0.025 / 1.05 + 0.5 / p))