Page 1 of 1

Can't view model as sketch

Posted: Mon Nov 24, 2014 4:28 pm
by jordan888
Strangly, when I open my model it goes straight to the equation viewer. When I try to view->as sketch, it says 'syntax error.' When I try running the model it also says 'syntax error,' but won't let me correct the error. I'm not sure what is wrong with my model. It was functioning without error when last I saved it.

Re: Can't view model as sketch

Posted: Mon Nov 24, 2014 4:50 pm
by Administrator
Will the attached open ok?

Re: Can't view model as sketch

Posted: Mon Nov 24, 2014 5:18 pm
by jordan888
Yes, I it works now. Thank you

Re: Can't view model as sketch

Posted: Mon Nov 24, 2014 7:40 pm
by tomfid
In the text editor, Vensim actually puts the cursor at the location of the error, which is:

Code: Select all

"23 to ENV 133 0"=A FUNCTION OF("23 to ENV 133 0","214 Major 640 Excess","214 to BRID 1"\
		,"214 to BRID2","214 to McGregor Out",Time) ~~|
MAX(0,MIN("214 Major 640 Excess",MIN(McGregor Available+Outsim div 426(Time)+BRID Irrig Dem\
		-MAX("23 to Irrig336&338"+"23 to irrig 339"
	,BRID flow 2),MIN(MAX(0,ENV 133 dem(Time)-(BRID flow 2-BRID Flow 1)),max div 420(Time\
		)-"214 to BRID 1"-"214 to BRID2"-"214 to McGregor Out"
	))))
	~	
	~		|
Notice that the MAX expression starts right after the ~~|, without specifying a variable on the left hand side.

Re: Can't view model as sketch

Posted: Tue Jun 09, 2015 11:31 am
by Aurora
I am experiencing the same problem. My model is qualitative, so I have no equations. Any way to deal with this?

Re: Can't view model as sketch

Posted: Tue Jun 09, 2015 11:41 am
by Administrator
In text view, replace

Code: Select all

Ability to protect farming land=
	~	
	~	FH01-095; FH01-097; FH01-099; FH01-105 (Ability to protect harvest); \
		FH01-030 (Ability to protect farming land) 
	|
with

Code: Select all

Ability to protect farming land=A FUNCTION OF()~~|
Ability to protect farming land=
	~	
	~	FH01-095; FH01-097; FH01-099; FH01-105 (Ability to protect harvest); \
		FH01-030 (Ability to protect farming land) 
	|
And then click View->As Sketch.

Re: Can't view model as sketch

Posted: Tue Jun 09, 2015 11:51 am
by Aurora
Thanks a lot! it works perfectly now!

Re: Can't view model as sketch

Posted: Tue Jun 09, 2015 12:24 pm
by LAUJJL
Hi Aurora
Just a question. What do you expect from this model?
The model is so complex that if you select le level fariming land and click on the loops tool Vensim is not able to find the number of loops and apparently crashes.

Regards.
JJ

Re: Can't view model as sketch

Posted: Tue Dec 19, 2023 2:37 pm
by thifei
Hello,

I have the same problem. When I click 'view as sketch' nothing happen, the model stays in text mode.

It first openned the file in this mode, I didn't go to text mode by myself, don't know if it helps.

Re: Can't view model as sketch

Posted: Fri Dec 22, 2023 3:14 pm
by tomfid
This means there are syntax errors in the equations. Use Check Model <ctl><T> to see the error window.

Re: Can't view model as sketch

Posted: Tue Jan 09, 2024 9:23 am
by thifei
The error window gives a syntax error (missing equation) for the last line:

initial pmr[Country] = A FUNCTION OF( ) ~~|
initial pmr[Country]=
~
~ |

Even if I give a value after the = sign the problem persists.
I didn't modify anything in the code by myself, it just openned this way.

Re: Can't view model as sketch

Posted: Tue Jan 09, 2024 10:34 am
by Administrator
Try changing this to the following and see if it now opens.

Code: Select all

initial pmr[Country]=0
~
~ |

Re: Can't view model as sketch

Posted: Tue Jan 09, 2024 3:32 pm
by thifei
Yes I solved the problem by removing the right hand side of the equation each time. Any idea of what happenned ?

Thank you

Re: Can't view model as sketch

Posted: Thu Apr 25, 2024 10:36 am
by OlevA
Hello,

I have a similar problem, yesterday I worked on my model saved it and closed the applications. Today when I try to open it only opens as text and I can't switch to the sketch view. I checked the model with model check and it seems to be ok. Do you have any Ideas on how to fix this issue? I can attach the model if needed.

Kind Regards
Ole