Some calculation imprevements done.

This commit is contained in:
klaute 2016-09-21 10:32:10 +02:00
parent 3caf25b9b7
commit 330e4d08a1

View file

@ -488,7 +488,9 @@ if __name__ == "__main__":
meas_r = []
meas_p = []
if args.output_file != None or args.output_file != None:
i = ((drive_str + 1) * 2) / 1000
if args.output_file != None or args.show_graph == True:
for m in meas_data:
meas_freq.append(m[0])
@ -500,13 +502,13 @@ if __name__ == "__main__":
else:
meas_ratio.append(1)
# R = meas_data[0] * 5V / 1023
r = (m[1] * 5 / 1023)
# R = meas_data[0] * 5V / 1023 * I
r = (m[1] * 5 / 1023) * i
meas_r.append(r)
# P = meas_data[0] * 5V ^ 2 / r
if r > 0:
meas_p.append((m[1] * 5)**2 / r)
meas_p.append(i**2 * r)
else:
meas_p.append(0)