From c45c60b8713053038a0d819dfd2dde4064235a4d Mon Sep 17 00:00:00 2001 From: Ali Saadati Date: Thu, 14 Jan 2021 22:54:39 +0330 Subject: [PATCH] calculate Boltzman and Avogadro number with resaults of the beadtracker --- avogadro.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 avogadro.py diff --git a/avogadro.py b/avogadro.py new file mode 100644 index 0000000..274ef39 --- /dev/null +++ b/avogadro.py @@ -0,0 +1,27 @@ +import math +import stdlibrary.stdio as stdio + +def main(): + ''' + this function will receive resaults of beadtracker + ''' + inp = input().split('\n') + while not stdio.isEmpty(): + inp.append(stdio.readFloat()) + + D = 0 + for i in inp: + D += float(i)**2 + D /= 2*len(inp) + D *= (175e-9)**2 + + # boltzman constant + k = (6 * D * math.pi * 9.135e-4 * 5e-7) / 297 + + # print resaults + print('Boltzman :', k, '\nAvogadro :', (8.31446/k)) + + + +if __name__ == "__main__": + main() \ No newline at end of file