I'm developing a model of thermodynamic cycle in Mathematica. I wrote several functions, applied them to a list containing starting values and iterated, for the model to converge.
fixed = FixedPoint[
f1[f2[Nest[f3,f4[f5[f6[Nest[f7, f8[#], 100]]]],100]]] &, startinglist, 20];
I would like to see not only final, converged values, but also values at each other point of the cycle, so I threw them into a grid:
data = {
Prepend[fixed, "starting point"],
Prepend[f8[fixed], "before condenser"],
Prepend[Nest[f7, f8[fixed], 100], "after condenser"],
Prepend[f6[Nest[f7, f8[fixed], 100]], "before pump"],
Prepend[f5[f6[Nest[f7, f8[fixed], 100]]], "after pump"],
Prepend[f4[f5[f6[Nest[f7, f8[fixed], 100]]]], "before heat exch"],
Prepend[Nest[f3, f4[f5[f6[Nest[f7, f8[fixed], 100]]]], 100], "after heat exch"],
Prepend[f2[Nest[f3,f4[f5[f6[Nest[f7, f8[fixed], 100]]]], 100]],"before turbine"],
Prepend[f1[f2[Nest[f3,f4[f5[f6[Nest[f7, f8[fixed], 100]]]], 100]]], "after turbine"]
};
Text@Grid[
Prepend[data, {"Point", "Temp [\[Degree]C]", "pressure [bar]", "enthalpy [kJ/kg]",
"enthropy [kJ\kg\K]", "density [kg/m3]", "viscosity [kg/m/s]", "quality [-]"}],
Frame -> All]
It works, but doesn't look very clean. The second thing is that while creating data Mathematica is once again performing Nest, which might consume a lot of time, if I'm going to extend my model. Any other ways to do all of that quicker?