Evaluating properties based on an array of input parameters
See original GitHub issueFor example, if I have a large numpy array of temperature values (say a million-element long), other than calling thermo
in a for loop, is there a vectorized way to extract properties from thermo
?
Many thanks, Amin
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Select a property from an array of objects based on a value
It will evaluate the method passed in foreach for each element of the array and check if the element.checked is true it will...
Read more >Data Structures: Objects and Arrays - Eloquent JavaScript
When using square brackets, the expression between the brackets is evaluated to get the property name. Whereas value. x fetches the property of...
Read more >Destructuring assignment - JavaScript - MDN Web Docs
The destructuring assignment syntax is a JavaScript expression that makes it possible to unpack values from arrays, or properties from ...
Read more >Set or skip an object property based on a condition · Issue #387
I'd like to be able to define all rules in one array and use bool parameters to control which rules to be included...
Read more >Select statment from a Filter Array - Power Platform Community
Solved: Hi, im runing a flow which suppose to get a list of items from excel than im filtering it with Filter array....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi,
I added an example of using multiprocessing to speed up multiple phase equilibria calculations: https://thermo.readthedocs.io/Examples/Performing Large Numbers of Calculations with Thermo in Parallel.html I hope this is helpful. I don’t have any plans to vectorize calculations further or add a convenience wrapper which allows numpy arrays as inputs. I don’t know what broadcasting rules would be best for that sort of an interface, and I don’t think using a loop is too onerous on users. The numba backend will hopefully continue to be developed for those who want to use numba’s parallelization features. I can try to answer specific questions about parallelism here if you have questions.
Sincerely, Caleb
Hi Amin,
My experience with CFD suggests tabular interpolation is the way to go. Calculating these properties will definitely be one of the slowest steps, and applying simplifications is normal - calling thermo directly would be too slow no matter what happened.
So you might make a lookup table of say T, P, and composition; and fill it out with values from thermo. Then during the simulation, interpolate with the nearest values. Some of numpy’s interpolation routines might be suitable but more likely would also be too slow.
Sincerely, Caleb