Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need to be able to program a double interpolater for this table. I was able to

ID: 3551064 • Letter: I

Question

I need to be able to program a double interpolater for this table. I was able to get it to work for the first column but when I move over it errors out because it is still referencing the first column.


Due to the complexity of the functions, Generalized Correlations beyond a limited window are often obtained from a data table with the compressibility, Residual properties and fugacity coefficients obtained as a function of Reduced Temperature and Reduced Pressure. Develop a macro that will double Interpolate for a given Tr and Pr.

Explanation / Answer


=match(D2,$A$2:$A$555,1) gives the row number within 2-555 where the X value just lower than the X value in D2 is located  (we'll store this value in E2)

=INDEX($A$2:$A$555,E2,1) gives the value of "lower X" (we'll store it in F2)

=INDEX($A$2:$A$555,E2+1,1) gives the value of "upper X" (we'll store it in G2)

=INDEX($B$2:$B$555,E2,1) gives the value of "lower Y" (we'll store it in H2)

=INDEX($B$2:$B$555,E2+1,1) gives the value of "upper Y" (we'll store it in I2)

=(D2-F2)/(G2-F2)*(I2-H2)+H2 gives us the value we are looking for.

alternatively, we could condense all of those equations into one bulky one:

=(D2-INDEX($A$2:$A$555,match(D2,$A$2:$A$555,1),1))/(G2-INDEX($A$2:$A$555,match(D2,$A$2:$A$555,1),1))*(INDEX($B$2:$B$555,match(D2,$A$2:$A$555,1)+1,1)-INDEX($B$2:$B$555,match(D2,$A$2:$A$555,1),1))+INDEX($B$2:$B$555,match(D2,$A$2:$A$555,1),1)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote