Unable to run equilibrate_tv() function. NameError: name 'P' is not defined
Summary
I have a defined temperature in C and volume in J/bar. I am attempting to run a constant T, V equilibration calculation to get at the other parameters of the system (my main goal is to calculate the pressure in an isochoric, isothermal system with known T, X, and V)
Steps to reproduce
Full notebook attached here, but this is the offending line of code:
output = melts.equilibrate_tv(temp_C, V_joules_per_bar, initialize=False)
Example Notebook
Example notebook with complete working example attached.
What is the current bug behavior?
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
/var/folders/r3/675zftxx1r794r3v5mst_hzm0000gp/T/ipykernel_8729/1387048163.py in <module>
----> 1 output = melts.equilibrate_tv(temp_C, V_joules_per_bar, initialize=False)
2 output[0]
/opt/anaconda3/lib/python3.9/site-packages/thermoengine/equilibrate.py in equilibrate_tv(self, T_a, V_a, initialize)
4465 output_NSDictionary = self.melts.execute()
4466 xmlout = ET.fromstring(str(self.melts.equilibrateResultsAsXML()))
-> 4467 output_a.append((str(output_NSDictionary.objectForKey_('status')), T, P, xmlout))
4468 return output_a
4469
NameError: name 'P' is not defined
What is the expected correct behavior?
The calculation should complete and not error out.
Possible fixes
As best as I can tell, this function should not return T and P? P is not a variable set anywhere within that function in the source code. Is this possibly a typo where it should be returning T and V? Or should P be calculated inside the function? Perhaps it is but not properly named 'P'
Edited by Kayla i