Can't view model as sketch

Use this forum to post Vensim related questions.
Post Reply
jordan888
Junior Member
Posts: 13
Joined: Tue Apr 30, 2013 5:04 pm
Vensim version: DSS

Can't view model as sketch

Post 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.
Attachments
working_model_nov18_PC.mdl
(667.24 KiB) Downloaded 371 times
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: Can't view model as sketch

Post by Administrator »

Will the attached open ok?
Attachments
working_model_nov18_PC MODIFIED.mdl
(667.88 KiB) Downloaded 350 times
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
jordan888
Junior Member
Posts: 13
Joined: Tue Apr 30, 2013 5:04 pm
Vensim version: DSS

Re: Can't view model as sketch

Post by jordan888 »

Yes, I it works now. Thank you
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Can't view model as sketch

Post 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.
Aurora
Junior Member
Posts: 2
Joined: Tue Jun 09, 2015 11:18 am
Vensim version: DSS

Re: Can't view model as sketch

Post by Aurora »

I am experiencing the same problem. My model is qualitative, so I have no equations. Any way to deal with this?
Attachments
Ethiopia Hiruy 2015_06_08 simplified 1.mdl
(175.76 KiB) Downloaded 336 times
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: Can't view model as sketch

Post 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.
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
Aurora
Junior Member
Posts: 2
Joined: Tue Jun 09, 2015 11:18 am
Vensim version: DSS

Re: Can't view model as sketch

Post by Aurora »

Thanks a lot! it works perfectly now!
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Re: Can't view model as sketch

Post 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
thifei
Junior Member
Posts: 11
Joined: Mon Dec 11, 2023 4:05 pm
Vensim version: DSS

Re: Can't view model as sketch

Post 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.
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Can't view model as sketch

Post by tomfid »

This means there are syntax errors in the equations. Use Check Model <ctl><T> to see the error window.
thifei
Junior Member
Posts: 11
Joined: Mon Dec 11, 2023 4:05 pm
Vensim version: DSS

Re: Can't view model as sketch

Post 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.
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: Can't view model as sketch

Post by Administrator »

Try changing this to the following and see if it now opens.

Code: Select all

initial pmr[Country]=0
~
~ |
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
thifei
Junior Member
Posts: 11
Joined: Mon Dec 11, 2023 4:05 pm
Vensim version: DSS

Re: Can't view model as sketch

Post 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
OlevA
Newbie
Posts: 1
Joined: Thu Apr 25, 2024 10:18 am
Vensim version: DSS

Re: Can't view model as sketch

Post 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
Post Reply