removing ~ and | from changes files

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

removing ~ and | from changes files

Post by RWTH_FCN »

Hello everyone,

im trying to get an old model of ours back running. Whenever I use the old changes file (.cin), VenSim gives me an error at every point where "~~|" is in the file. If I remove it everything works fine, but I am worried that it might effect the outcome? What function did the symbols have and why do they cause an error now and did not in earlier versions?

The documentation states that " The format for .cin (Constant INput) files is much the same as that of Constant and Lookup equations, except that the tildes ~ and bars | are not needed." (https://www.vensim.com/documentation/in ... _files.htm). So I can remove it without effecting the output?

Thank you in advance
Administrator
Super Administrator
Posts: 4589
Joined: Wed Mar 05, 2003 3:10 am

Re: removing ~ and | from changes files

Post by Administrator »

Model files usually have ~~|, not CIN files.

Open it in notepad and take a look, it's probably a model file.
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: 3808
Joined: Wed May 24, 2006 4:54 am

Re: removing ~ and | from changes files

Post by tomfid »

However, the documentation does permit ~ for comments in changes files, so the errors should not be ignored silently, I think. I'll take a look.
RWTH_FCN
Senior Member
Posts: 148
Joined: Wed Feb 08, 2017 9:10 am
Vensim version: DSS

Re: removing ~ and | from changes files

Post by RWTH_FCN »

Well its one of the files I specify in "load changes from.." before i start the simulation. What would be the difference to a model file and how could I tell?
I mean the documentation states "The format for .cin (Constant INput) files is much the same as that of Constant and Lookup equations, except that the tildes ~ and bars | are not needed."

This is part of the .cin file I'm talking about:

"run number =65
~ ~ |

final time =73249
~ ~ |

Price Cap for Auction by year[B Reg, year] =25,
25.225,
25.453375,
25.685175625,
25.920453259375,
26.1592600582656,
26.4016489591396,
26.6476736935267,
26.8973887989296,
27.1508496309135,
27.4081123753772,
27.6692340610079,
27.934272571923,
~ ~ |"

So can I remove the tildes and waves without messing something up?

Thank you in advance
Administrator
Super Administrator
Posts: 4589
Joined: Wed Mar 05, 2003 3:10 am

Re: removing ~ and | from changes files

Post by Administrator »

That definitely looks like a model file. So no, removing the ~ and | will probably not work.
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
Administrator
Super Administrator
Posts: 4589
Joined: Wed Mar 05, 2003 3:10 am

Re: removing ~ and | from changes files

Post by Administrator »

You'll need to create a new CIN file. Please note, I don't know what the elements of the "year" subscript range are, so this is just a guess.

Code: Select all

run number =65
final time =73249
Price Cap for Auction by year[B Reg, year1] =25
Price Cap for Auction by year[B Reg, year2] =25.225
Price Cap for Auction by year[B Reg, year3] =25.453375
...
...
etc
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: removing ~ and | from changes files

Post by RWTH_FCN »

Okey, so its a model file even though i load it in "load changes from..." ?

This is what happens when I try to run it WITH the waves and tildes:

"Reading changes from file data v65.cin
ERROR: Bad line 2 in file data v65.cin not recognized.
~ ~ |.
-^.
Line 2 of file data v65.cin.
ERROR: Bad line 5 in file data v65.cin not recognized.
~ ~ |.
-^.
Line 5 of file data v65.cin.
[...]
"

Removing the waves in tildes does work and the simulation is succesfull. Just wondering if it messes with my results.... Most of the inputs in the file are set up like
"Price Cap for Auction by year[B Reg, year] =25,
25.225,
25.453375,
25.685175625,
25.920453259375,
26.1592600582656,
26.4016489591396,
26.6476736935267,
26.8973887989296,
27.1508496309135,
27.4081123753772,
27.6692340610079,
27.934272571923,
~ ~ |"

So it would be a real pain to change all of them to the format you suggested. I am confused.
Administrator
Super Administrator
Posts: 4589
Joined: Wed Mar 05, 2003 3:10 am

Re: removing ~ and | from changes files

Post by Administrator »

Removing the waves in tildes does work and the simulation is succesfull. Just wondering if it messes with my results
Look at the constants that are read in using the table tool to see if they have been read in ok.
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: removing ~ and | from changes files

Post by RWTH_FCN »

Alright, looks like it is read in right. I attached a screenshot so you can take a look. Looks like its working, doesnt it?
VenSim_Table.jpg
VenSim_Table.jpg (76.58 KiB) Viewed 4992 times
Still dont understand the difference between a model file and a changes file if they are both read in through "load changes from..." and fulfill the same job? Or am i missing sth.?

Thanks for your help!
Administrator
Super Administrator
Posts: 4589
Joined: Wed Mar 05, 2003 3:10 am

Re: removing ~ and | from changes files

Post by Administrator »

Still dont understand the difference between a model file and a changes file if they are both read in through "load changes from..." and fulfill the same job? Or am i missing sth.?
A model file is never read in using the "Load changes from..." button. You load a model in Vensim using File->Open model. Someone has given you a model, and changed the extension from MDL to CIN. You'll need to ask the person who gave you these files why.

The model file contains all the equations and sketch information that you usually see on screen when using Vensim. A CIN file contains constants that are used to initialise the various calculations in the model.
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: 3808
Joined: Wed May 24, 2006 4:54 am

Re: removing ~ and | from changes files

Post by tomfid »

The obvious difference is that a model contains dynamic equations, whereas a .cin file is just constants.

It appear that this does actually work due to some old semi-documented syntax. You could probably suppress the warnings by just deleting the ~~|. Or, just ignore them.
Post Reply