Thank you Tom. I did mention to JJ that since these values you are see (in lieu of expressions) will be changing in Vensim, it is not possible to put them in as a subscript or a reverse subscript. This is why I am suggesting that the output of Vensim I am looking for, to run in an external expression, is the a list output from an auxiliary variable. I hope that makes sense. I have made that one simplification to provide constants instead of expressions in the Excel file as a demonstration, but the only thing that I need to achieve is demonstrated by the yellow highlighted columns.Obviously id depends on how big the FEA is, but if there's a good reason to use the above form, then it makes sense to do so.
The code in the Excel file still seems underspecified to me, because a bunch of the columns are numbers rather than expressions. However, if "invert" means that you just need:
i : (i1-i5)
y[i1] = x[i1]*z[i5]
y[i2] = x[i2]*z[i4]
...
y[i5] = x[i5]*z[i1]
that's easy. You can create a second subscript with the elements in reverse order, or use VECTOR ELM MAP for arbitrary access to elements. I'd probably prefer the latter. The offsets for the elements are as in your xfn, list1->vals[n_values - i - 1] * list2->vals.
I hope that makes sense.
As for the compiling, I will see what I can do. I think it is working, so far, as a cpp --. .dll, but the calculations themselves are suspect. If I do them by hand, the outputs from Vensim do not match. This is actually simple multiplication. The only difficult part is taking the g-function outputs (including all previous values), at each timestep, and feeding them to the function as a list, to be reversed, then multiplied by the difference in heat to the heat exchange (represented by "qi-qi-1").
You can see the values above from each time step appear as expected, but the product then sum of those values do not match. So, there is either something wrong with the function itself, or there is something going on with the integration that is not working well with my expectations.data from the first 3 timesteps for "qi-qi-1":
0 = 0; 1 = 0; 2 = -5.79858; 3 = 1.55211
data from the first 3 timesteps for gfunction output:
0 = 2.49682; 1 = 2.49682; 2 = 2.49682; 3 = 2.49682
data from the output of REVERSE AND MULTIPLY SUM():
0 = 0; 1 = 0; 2 = -14.478; 3 = 15.278