I want to create an AF tag for something that calculates temperature of a small vessel. The calculations used to solve for T are very complex (e.g. exp^(A+B/T+ClnT+DT^E)). Algebraically I cannot isolate this variable to do a 'formula' data reference. Historically this value has been solved for by doing iterations until a Pressure found using the T Calc value matches the Pressure sensor value.

I know one way to accomplish this is using VBA to generate a very large table of values so that for given input 1 and given input 2 I can do a table look up for the T value, but I'm not good at VBA.

Any other ways to accomplish this in PI AF or other PI Tool?

If anyone is interested, I figured out how to use Newton's Method to create an excel 'solver' within PI AF. Since the calculation I'm doing converges pretty easily, I was able to be successful here. I'm sure there are calculations that require too many iterations to pull this off within a PI AF analysis.

Newton's Method: Xn+1 = Xn - [f(Xn)/f'(Xn)]

Youtube video I used to relearn Newton's Method: Newton's Method - YouTube

Please let me know if there is a better practice/way to accomplish this. I'd like to optimize my analytics where possible.