I am using the VensimDLL to analyze Vensim models in Mathematica. Doing this I will build a model graph using the adjacency information provided by listing the causes and uses of a variable (e.g. a graph-vertex) when applying the DLL function VensimGetVarAttrib. I just noted that there seems to be an inconsistency with this function when Macros are envolved.
I have enclosed a very simple model to demonstrate this. In that model there are three variables:
Code: Select all
someFractionalRate = 0.1 ~ ~|
modelFractionalRate = CONTINUOUSRATE(someFractionalRate) ~ ~|
stockToGrow = INTEG ( modelFractionalRate * stockToGrow, 100) ~~|
someFractionalRate -> modelFractionalRate -> stockToGrow
Indeed that is what, asking for the causes , is reported by the DLL, e.g. VensimGetVarAttrib[ "modelFractionalRate", 4] returns a list of string containing only the variable someFractionalRate (the macro variable is not showing here).
But if you are inquiring about the uses of the variable someFractionalRate a different picture is drawn: Here VensimGetVarAttrib[ "someFractionalRate", 4] will return the macro variable #modelFractionalRate>CONTINUOUSRATE# and not modelFractional Rate as the simple minded user would expect. Interestingly the uses of that variable will list modelFractionalRate also, but it never appears in the causes list for modelFractionalRate as shown above.
I do find this behavior inconsistent: Either the causal chains reported will always include the macro variables or they should never report them. The asymmetric behavior in my case leads to a broken causal chain in the model graph.
Or am I missing something here?
Best regards,
Guido