Skip to content
/ pycalphad Public

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

# Calculate gives the wrong result if pressure and temperature are not both specified.#116

Closed
opened this issue Aug 3, 2017 · 3 comments
Closed

# Calculate gives the wrong result if pressure and temperature are not both specified. #116

opened this issue Aug 3, 2017 · 3 comments
Assignees
Labels
Milestone

## Comments

### bocklund commented Aug 3, 2017 • edited

 In the binary example, we see the following code produce this plot ```from pycalphad import calculate from pycalphad.plot.utils import phase_legend import numpy as np legend_handles, colorlist = phase_legend(my_phases_nbre) fig = plt.figure(figsize=(9,6)) ax = fig.gca() for name in my_phases_nbre: result = calculate(db_nbre, ['NB', 'RE'], name, T=2800, output='GM') ax.scatter(result.X.sel(component='RE'), result.GM, marker='.', s=5, color=colorlist[name.upper()]) ax.set_xlim((0, 1)) ax.legend(handles=legend_handles, loc='center left', bbox_to_anchor=(1, 0.6)) plt.show()``` But changing the temperature to 300 or 1000000 gives the same plot (and the same values from calculate). If you specify pressure in calculate e.g. `result = calculate(db_nbre, ['NB', 'RE'], name, T=2800, P=101325, output='GM')` the resulting plot is Further changes to temperature produce expected results. The energy surface plotted when P is not specified gives a similar result to T>=6000 (piecewise max in TDB). I assume this is a bug and not the intended result? The text was updated successfully, but these errors were encountered:
added the bug label Aug 6, 2017
added this to the 0.6 milestone Sep 26, 2017
mentioned this issue Sep 26, 2017

### amjokisaari commented Sep 26, 2017

 Please make this throw an error if something isn't specified, instead of silently calculating the wrong thing, as suggested by @richardotis.

### richardotis commented Nov 5, 2017

 In https://github.com/pycalphad/pycalphad/blob/develop/pycalphad/core/calculate.py#L428 The assigned values to `statevar_dict` need to be wrapped with a call to `unpack_condition()` That should fix it.

### richardotis commented Nov 5, 2017

 That does not fix the issue. Still investigating.

added a commit that referenced this issue Nov 5, 2017
``` FIX: Maintain sorted state variable ordering when one or more state v… ```
``` fa08f6a ```
`…ariables is left as default. Fixes gh-116.`
mentioned this issue Nov 5, 2017
added a commit that referenced this issue Nov 12, 2017
``` FIX: Maintain sorted state variable ordering when one or more state v… ```
``` 0a3e84e ```
`…ariables is left as default. Fixes gh-116.`
added a commit that referenced this issue Nov 12, 2017
``` FIX: Maintain sorted state variable ordering when one or more state v… ```
``` 699468c ```
`…ariables is left as default. Fixes gh-116. (#140)`
added a commit that referenced this issue Nov 26, 2017
``` FIX: Maintain sorted state variable ordering when one or more state v… ```
``` 85c85f5 ```
`…ariables is left as default. Fixes gh-116. (#140)`
added a commit to bocklund/pycalphad that referenced this issue Aug 17, 2021
``` DOC: Reorganize docs (pycalphad#116) ```
``` 6c5a499 ```
```* Add recipes from the Cu-Mg example
* Add some more ESPEI background to the main page
* Make a new How-to section in the docs and reorganize appropriate things to that place```
to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants