Find variables that use external functions

Use this forum to post Vensim related questions.
Post Reply
RWTH_FCN
Senior Member
Posts: 148
Joined: Wed Feb 08, 2017 9:10 am
Vensim version: DSS

Find variables that use external functions

Post by RWTH_FCN »

Hey everyone,

in order to use an old model with the new vensim version I had to adjust and recompile my external functions. Unfortunatly now the results with the newer version are slightly different compared to the the results running with the older version. I think it might be because of my external functions. I thought I would create a new savelist with all the variables the are calculated with external function and then compare new and old versions results.

My Question: Is there an easy way to find all the variables that are calculated with the external functions? Looking through the model manually would be too much work.

Thank you in advance.

Cheers
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: Find variables that use external functions

Post by Administrator »

There is not an easy way. You could unload the DLL and then open the model, it will take you to the syntax errors which will be the offending parameters.

Or do a runs compare and see where the differences start.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
RWTH_FCN
Senior Member
Posts: 148
Joined: Wed Feb 08, 2017 9:10 am
Vensim version: DSS

Re: Find variables that use external functions

Post by RWTH_FCN »

Alright, I will try that. Thanks for your help.
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Find variables that use external functions

Post by tomfid »

... or do a text search in the text view.
RWTH_FCN
Senior Member
Posts: 148
Joined: Wed Feb 08, 2017 9:10 am
Vensim version: DSS

Re: Find variables that use external functions

Post by RWTH_FCN »

So a runs compare only makes sense, when I use a savelist with all my important (the ones directly stemming from external functions) variables, since I only compare the saved datasets, right? So I tried to find the variables via the text search. I looked up all my external functions in the equation editor under "User defined functions". I noticed that sometimes the external functions name was e.g. "A_B_C" but in the text view of the model the function was only "A B C", which makes it hard to find them. I dont get any errors running it, so I assume that vensim is able to load those functions anyway. But how so, if the name is (even though slightly) different?
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: Find variables that use external functions

Post by Administrator »

Start by doing a runs compare on just data and constants, just in case there was an error setting the model up.

Next, unload the external function library. Open Vensim and a copy of the model (keep the original safe), and do a model check. It should take you to the calls to the external function library (as they will now be syntax errors). Make a note of the parameter, and then make the equation "0" so it's no longer a syntax error. Check the model again and it will take you to the next syntax error. This is the only way I can think of to get at the full list of parameters.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Find variables that use external functions

Post by tomfid »

Vensim is generally indifferent to space vs. underbar in names. There's an option to switch display from one to the other, but the default is to use spaces, so a function defined in C as a_b_c will appear as a b c.
Post Reply