Page 1 of 1

"Not able to analyze model" in status bar: can't switch model views

Posted: Tue Aug 09, 2016 12:20 am
by pbreach
I'm trying to open a model (created in 2011 if that helps) and the first thing that comes up is the text inside the mdl. So I go to View->As Sketch and then I get a dialog that pops up with "Syntax Error." which points to this statement:
vensimOutput=
WRITE(Tau1,Tau2,Tau3,b1 0,b2,b3,Pfz1,Pfz2,Pfz3,PR1,PR2,PR3,Rz1,Rz2, Rz3, alpha, beta 0\
, gamma, rho 0, theta,
At,OMt,L,a4,a5,b4
,mu1,mu2,kappa3, eta el,eta h,om,Ael,Ah,K 0,k1 0,k2 0,k3 0,k4 0,k5,writetime)
~
~ |
I removed the statement (wasn't sure what was wrong with the syntax) then tried "View->As Sketch" again, which now works and I can see the stock and flow diagram. There are multiple views to the model, but in the status bar where I go to switch the views all it says is "Not able to analyze model". I checked View->Reorder and it shows that there are other model views there.

Where should I start to resolve the "Not able to analyze model" error? Could it be because of the section I removed from the .mdl file? What was wrong with the syntax in the quoted section?

Re: "Not able to analyze model" in status bar: can't switch model views

Posted: Tue Aug 09, 2016 1:59 am
by tomfid
It looks like you're using an external function - check that you have the proper library specified in Tools>Options>Startup.

Re: "Not able to analyze model" in status bar: can't switch model views

Posted: Tue Aug 09, 2016 6:53 am
by pbreach
Good catch. I didn't realize the model was using external functions until now. I think the DLL containing the external functions was put together with files from an older version of Vensim. Does that mean it will need to be recompiled?

Thanks for the prompt reply.

Re: "Not able to analyze model" in status bar: can't switch model views

Posted: Tue Aug 09, 2016 1:48 pm
by tomfid
Normally, no - the headers rarely change. However, there have been a few changes, so if your library is old enough, it would need recompiling. You should get a warning about it at startup.

Re: "Not able to analyze model" in status bar: can't switch model views

Posted: Wed Aug 17, 2016 6:04 pm
by pbreach
So it turns out the external function library is using some other proprietary libraries that I can't get my hands on. Even if I did want to try and re-compile it is not an option. All I want to do is be able to see the model sketch! I'm planning on re-implementing the part that is used in the external library anyways as it can actually be done entirely in Vensim.

Is there any other way I can see the model sketch without loading the external library??

Re: "Not able to analyze model" in status bar: can't switch model views

Posted: Wed Aug 17, 2016 6:10 pm
by pbreach
I forget to mention that it does seem it would need to be re-compiled. I tried specifying dll in Tools->Options->Startup->External function library but it says "The external functions in ... cannot be loaded. Do you want to try again next time?". Clicked "Yes", Vensim restarts and then when I go to View->As Sketch I still get "Syntax Error".

Did this in both single and double precision versions just in case and got the same result.

Re: "Not able to analyze model" in status bar: can't switch model views

Posted: Wed Aug 17, 2016 8:23 pm
by Administrator
Change
vensimOutput=
WRITE(Tau1,Tau2,Tau3,b1 0,b2,b3,Pfz1,Pfz2,Pfz3,PR1,PR2,PR3,Rz1,Rz2, Rz3, alpha, beta 0\
, gamma, rho 0, theta,
At,OMt,L,a4,a5,b4
,mu1,mu2,kappa3, eta el,eta h,om,Ael,Ah,K 0,k1 0,k2 0,k3 0,k4 0,k5,writetime)

to
vensimOutput=0
or
Tau1+Tau2+Tau3+b1 0+... +k5+writetime

Then click view->As sketch.

The first option is easier and quicker, but you will loose the connections from Tau1, tau2 etc into "vensimoutput". The 2nd way will preserve these links, but obviously the result will not be correct. "WRITE" suggests it's writing to a file, so option 1 might be ok.

Re: "Not able to analyze model" in status bar: can't switch model views

Posted: Wed Aug 17, 2016 9:27 pm
by pbreach
I tried both option 1 and 2 and have the same error as in the original post, "Not able to analyze model" in the status bar. Is there any other alternative?

Re: "Not able to analyze model" in status bar: can't switch model views

Posted: Wed Aug 17, 2016 9:34 pm
by pbreach
Actually, somehow it's working now! I think I just had to restart Vensim another time manually. Thanks for all the help!