

- #INTERPOLATION FORMULA THERMODYNAMICS CALCULATOR HOW TO#
- #INTERPOLATION FORMULA THERMODYNAMICS CALCULATOR CODE#
VAR x1 = CALCULATE(MAX(H2OTempSat),FILTER(ALL(H2OTempSat),=x3)) VAR match = CALCULATE(MAX(H2OTempSat),FILTER(ALL(H2OTempSat),=x3)) In any event, create the following measusre: In fact, I would advise against it, although I have specifically engineered the formula to allow for active relationships between your interpolation table and the lookup table. Note that there is no reason to relate these tables to one another. Rename the single column in the table to Temp (C). You should now have an Interpolation table with numbers from 1 to 373 in increments of 1. You can do this by going to the Modeling tab of the ribbon and choosing New Parameter from the What If section or just click on New Table and use the following formula: Next, we want to create a table for our Interpolated values. OK, so what you should have loaded into a table now are the properties of water at temperatures in increments of 5 degrees Celsius from about 0 degrees to about 373 degrees.

#"Changed Type" = Table.TransformColumnTypes(Sheet2,) Source = Excel.Workbook(File.Contents(" C:\temp\powerbi\Thermo\H2O_TempSat.xls "), null, true), You will need to change the path in bold below for your own situation.
#INTERPOLATION FORMULA THERMODYNAMICS CALCULATOR CODE#
OK, so anyway, the data takes a little clean up, here is my Power Query code for cleaning up and importing the data. Marquart's problems EVER involved water at a temperature that was actually in these steam tables. But the problem is that not a single one of Dr.

For example, a Pressure-Enthalpy (P-h) diagram look like:

These kinds of property tables are very common in Thermodynamics and Fluid Mechanics and come in both chart (diagram) and table form. Now, to understand this data, these are tables of the properties of water at specific temperatures. So, as a practical example of using interpolation, I chose to go grab some Thermodynamic steam tables from this site here. So, you might be able to see how this could become a tad annoying if you had to do this 57 times in to solve a single Thermodynamics problem. Thus, for x3 that is between x1 and x2, we get the final formula: The slope of a line can be calculated with the formula m = (y2 - y1)/(x2 - x1). Using the two-point equation of a line, we get: y - y1 = m (x - x1), where m is the slope of the line. How can we accomplish this? Well, we can assume that the values between our known values of f( x) approximately fall along a straight line, like so: So, for example, suppose we have a set of data points like the following for some unknown function f( x) (reference the Wikipedia page hereīut, what we are interested in is what the value of f( x) is for a value of x=2.5. Essentially, interpolation is a method of creating new data points within the range of a set of known data points. Interpolation falls into the mathematical field of numerical analysis. So, here is the technique, but first a little background. Besides, while we generally deal with known data in things like Power BI, having the ability to do interpolation could come in pretty handy for certain situations as well as "What If" analysis.
#INTERPOLATION FORMULA THERMODYNAMICS CALCULATOR HOW TO#
And I figured that perhaps, if I could save just one mechanical engineering student just a few tens of thousands of hours of linear interpolation time that it would be worth writing a blog article on how to do linear interpolation with Power BI. So, since I've been on this kick of demonstrating how to do some numerical methods and other math stuff in Power BI, I recalled the dozens, if not tens of thousands, of hours I spent as an undergraduate painstakingly doing linear interpolation to solve Thermodynamics and Fluid Mechanics problems. Homework, tests and final exams seemed like 75% of the time spent was on doing linear interpolation calculations. Nice enough guy, but looking back at it, probably a bit of a sadist. Jed Marquart, for Thermodynamics and Fluid Mechanics. I know this from my own experience in earning my Mechanical Engineering degree at Ohio Northern University. If you are a mechanical engineer or mechanical engineering student, then you can skip past this introduction and the background information and just get right to the solution.
