Hi there, I'm working on the implementation of the EOS-PSRK model for ascend and I'm stuck with the SUM[] function.
I'm trying to understand how the thermodynamics.a4l file is calculating UNIFAC_mixture_g_excess[i] (LINE 985-1006) and how the binary interaction parameters are accessed. The problem I have is the following: UNIFAC_mixture_g_excess[i]: ... SUM[0,theta[k]* (SUM[0,data[i].nu[m]*uc.Q[m]| m IN data[i].subgroups*uc.sub[uc.group[k]]] + SUM[0,SUM[0,data[i].nu[m] * uc.Q[m] *exp(-uc.a[g][uc.group[k]]/T)| m IN data[i].subgroups*uc.sub[g]]| g IN data[i].groups - [uc.group[k]]])/eta[k]| k IN subgroups]*T/data[i].Tc + SUM[0,data[i].nu[k]*uc.Q[k]*lnm((SUM[0,data[i].nu[m]*uc.Q[m]| m IN data[i].subgroups*uc.sub[uc.group[k]]] + SUM[0,SUM[0, data[i].nu[m] * uc.Q[m] *exp(-uc.a[g][uc.group[k]]/T)| m IN data[i].subgroups*uc.sub[g]]| g IN data[i].groups - [uc.group[k]]])/eta[k])| k IN data[i].subgroups]*T/data[i].Tc; What happens here?: SUM[0, ... | g IN data[i].groups - [uc.group[k]]] with the binary interaction parameter given as: uc.a[g][uc.group[k] -> SUM[0, uc.a[g][uc.group[k] | g IN data[i].groups - [uc.group[k]]] As I understand data[i].groups are the maingroups for the component i, but when I take a look at the data of various substances only subgroups are documented. So actually data[i].groups needs to be an array of the subgroups a component can be dissected to. But this doesn't seem consistent with the declaration of groups :== [1..47] in components.a4l where a comment also says: "uc.groups is the main group list". uc.group[k] is stated to be an "array, group, that lets us look up the main group given a particular subgroup." in components.a4l. And what happens when subtracting uc.group[k] from data[i].groups for the index g which runs through the array to sum it up? Same question for the multiplication: SUM[0, ...| m IN data[i].subgroups*uc.sub[g]] Would be very helpful if someone could explain the syntax of the SUM function to me and how it handels the indexing. :-) Cheers, mark
------------------------------------------------------------------------------
_______________________________________________ Ascend-sim-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ascend-sim-users

