Fix bug that calculated wrong molecular weight

This commit is contained in:
rasmusthog 2022-10-23 13:48:45 +02:00
parent 97ac3505de
commit 27f9d2d2e6

View file

@ -547,7 +547,10 @@ def add_columns(df, options):
seconds_per_hour = 3600 # s h^-1
f = faradays_constant / seconds_per_hour * 1000.0 # [f] = mAh mol^-1
molecular_weight = options['molecular_weight'] * unit_tables.mass()['g'].loc[options['units']['mass']]
molecular_weight = options['molecular_weight'] * unit_tables.mass()['g'].loc[options['old_units']['mass']]
print(options['old_units']['capacity'], options['old_units']['mass'])
df["IonsExtracted"] = (df[f'C [{options["old_units"]["capacity"]}/{options["old_units"]["mass"]}]'] * molecular_weight)/f