Search found 3804 matches

by tomfid
Tue Jul 31, 2012 2:32 pm
Forum: Vensim
Topic: floating point error
Replies: 7
Views: 4007

Re: floating point error

Generally there should be no differences between integer and floating point operations, because integers are stored as floats (or doubles) in Vensim anyway. However, one possible operation that will cause trouble is a negative number to a non-integral power, like (-7.5)^2.334. In your sensitivity co...
by tomfid
Mon Jul 23, 2012 10:11 am
Forum: Vensim
Topic: One template model to apply more
Replies: 10
Views: 7265

Re: One template model to apply more

You're mixing two approaches here. The .cin file format can be loaded at runtime (Model>Simulate... and name the .cin file on the Changes tab using Load Changes From...). In a venapp, you would use SIMULATE>READCIN and ADDCIN. GET DIRECT calls will execute without specifying a .cin file. Normally th...
by tomfid
Mon Jul 23, 2012 10:02 am
Forum: Vensim
Topic: Vensim v6 crashes when attempting Stochastic Optimisation
Replies: 2
Views: 3328

Re: Vensim v6 crashes when attempting Stochastic Optimisatio

There was a bug in the output dialog in the initial release - you might want to download the latest 6.0.0.1 which was posted last Thursday or so.

Tom
by tomfid
Sat Jul 21, 2012 5:46 am
Forum: Vensim
Topic: Subscript range
Replies: 2
Views: 2102

Re: Subscript range

To simplify maintenance a bit, you can build up your ranges hierarchically, like a : a1,a2 b : (b1-b10) a and b : a, b This really only makes sense if a and b represent subsets of the same kind of thing, like cities in France, and cities in England. If what you're really after is a two-dimensional m...
by tomfid
Sat Jul 21, 2012 5:41 am
Forum: Vensim
Topic: model to show interdependencies
Replies: 10
Views: 5362

Re: model to show interdependencies

In other words

Code: Select all

change in x = x - previous x
previous x = DELAY FIXED(x, TIME STEP, x)
If you're running with Euler integration, you can use SMOOTH in place of DELAY FIXED.
by tomfid
Sat Jul 21, 2012 5:39 am
Forum: Vensim
Topic: One template model to apply more
Replies: 10
Views: 7265

Re: One template model to apply more

The scripted editing of the mdl approach would not work for interactive changes, but if the models can be generated in advance, you could manually package the results. However, this method is cumbersome, so I would not recommend it if there is another viable option. The basic idea is to write some k...
by tomfid
Sat Jul 21, 2012 5:33 am
Forum: Vensim
Topic: One template model to apply more
Replies: 10
Views: 7265

Re: One template model to apply more

Constants that are imported from GET XLS CONSTANTS should work in synthesim, at least in recent versions of Vensim. (For example, running the GET XLS CONSTANTS sample model linked in the Functions section of the Reference Manual, all of the constants are editable). The same should be true for .cin f...
by tomfid
Thu Jul 19, 2012 2:47 pm
Forum: Vensim
Topic: Compiled Model Question...
Replies: 6
Views: 4021

Re: Compiled Model Question...

The other obvious choice is gcc, which works fine on Mac & Linux. I have no personal experience with it on Windows though.
by tomfid
Thu Jul 19, 2012 2:45 pm
Forum: Vensim
Topic: A Bug in VENSIM DSS 6.0?
Replies: 2
Views: 2032

Re: A Bug in VENSIM DSS 6.0?

If it's possible to post a model that demonstrates the error, that's always helpful. Thanks.
by tomfid
Thu Jul 19, 2012 3:22 am
Forum: Vensim
Topic: One template model to apply more
Replies: 10
Views: 7265

Re: One template model to apply more

If I follow your requirements, you'd like to distribute the model without a linked Excel file, by instead embedding the constant/lookup changes in the model. Are you avoiding the Excel linkage to keep things simple (one file), or to avoid the user expense of acquiring Excel, or some other reason? If...
by tomfid
Wed Jul 18, 2012 2:02 pm
Forum: Vensim
Topic: Compiled Model Question...
Replies: 6
Views: 4021

Re: Compiled Model Question...

A likely candidate: on 64 bit systems, viz studio will be in C:\Program Files (x86) rather than C:\Program Files.
by tomfid
Wed Jul 18, 2012 2:00 pm
Forum: Vensim
Topic: Compiled Model Question...
Replies: 6
Views: 4021

Re: Compiled Model Question...

Have you checked http://blog.metasd.com/2011/06/setting-up-vensim-compiled-simulation-on-windows/ ? The most likely error is a path problem - perhaps your MSVC 2010 installed to a path that's a bit different from that in mdl.bat. I'd check that first. Specifically, you need the CL command (cl.exe) t...
by tomfid
Wed Jul 18, 2012 1:57 pm
Forum: Vensim
Topic: Vensim to Excel
Replies: 3
Views: 5046

Re: Vensim to Excel

It would take an external function to do this, which is serious programming.

A simpler approach is to write your output to an Excel-readable file (i.e. use VDF2TAB or VDF2XLS), and link your spreadsheet to that.
by tomfid
Wed Jul 18, 2012 1:54 pm
Forum: Vensim
Topic: Edit equations using scripts
Replies: 7
Views: 4924

Re: Edit equations using scripts

That sample model doesn't use aliases, so you'll need to modify the equations first. For each GET XLS call that references 'simpleInputs.xlsx' you need to replace the reference with an alias like '?input' and then define the alias to point to your spreadsheet by running the model or using Model>Sett...
by tomfid
Mon Jul 16, 2012 5:47 pm
Forum: Vensim
Topic: Not enough memory in Vensim
Replies: 12
Views: 7604

Re: Not enough memory in Vensim

Right. This is probably going to take about 120MB per step. It might run with a long SAVE PER, but that'll make it hard to debug. Sorry.
by tomfid
Mon Jul 16, 2012 4:46 pm
Forum: Vensim
Topic: Not enough memory in Vensim
Replies: 12
Views: 7604

Re: Not enough memory in Vensim

Typically a model that pushes memory limits will execute extremely slowly anyway.

Just how big is this one (as indicated by Model>Settings>Info)?
by tomfid
Mon Jul 16, 2012 4:40 pm
Forum: Vensim
Topic: Getting an array from Vensim to Excel
Replies: 6
Views: 4422

Re: Getting an array from Vensim to Excel

Sorry - hasty code writing without actually compiling never works. The loop should be: venVarOffset[0] = vensim_get_varoff("VensimVariable[ID1]") for ( id=1; id<10; id++ ) venVarOffset[id]=venVarOffset[0]+id; I think it should be the case that vensim_get_varoff("VensimVariable[ID2]&qu...
by tomfid
Sat Jul 14, 2012 1:00 am
Forum: Vensim
Topic: Getting an array from Vensim to Excel
Replies: 6
Views: 4422

Re: Getting an array from Vensim to Excel

779 is the offset of the element of VensimVariable[ID] that you pass in the storage matrix for variables. Typically, time has offset 1, the first level has offset 2, etc. So, if you have ID : (ID1-ID10) You should do something like the following: venVarOffset[0] = vensim_get_varoff("VensimVaria...
by tomfid
Thu Jul 12, 2012 10:27 pm
Forum: System Dynamics Discussion
Topic: investment model, need help plz
Replies: 13
Views: 12109

Re: investment model, need help plz

The key point for me is that it's easier to build a good model with units than without. Many people regard adding and checking units as an extra step, neglecting the huge savings in effort from avoided errors and improved clarity that it can bring.
by tomfid
Thu Jul 12, 2012 10:24 pm
Forum: System Dynamics Discussion
Topic: investment model, need help plz
Replies: 13
Views: 12109

Re: investment model, need help plz

It's a somewhat sorry state of affairs. I have to read a lot of unitless papers, because I'm a thread chair. I'd like to summarily reject them in most cases, but that would lead to an unfair asymmetry, because it's easier to judge the quality of a model provided in supplemental material rather than ...
by tomfid
Thu Jul 12, 2012 10:22 pm
Forum: Vensim
Topic: Getting an array from Vensim to Excel
Replies: 6
Views: 4422

Re: Getting an array from Vensim to Excel

During a game, you can use vensim_get_vecvals to retrieve an array, after first using vensim_get_varoff to retrieve offsets of the variable names. Otherwise, you need to iterate, repeating calls to vensim_get_data for each subscript element for which you want data, i.e. x[id1], x[id2], ... You can u...
by tomfid
Tue Jul 10, 2012 4:44 pm
Forum: Vensim
Topic: model to show interdependencies
Replies: 10
Views: 5362

Re: model to show interdependencies

Here's one way to do it:

D1 = INTEG( {stuff} , initial D1 )
initial D1 = {a constant}
change in D1 = (D1 - initial D1)

Another option, in DSS, is to define a macro:

:MACRO: INIT(x)
INIT = INITIAL(x)~x~|
:END OF MACRO:

Then you can write

change in D1 = D1 - INIT(D1)

Tom
by tomfid
Mon Jul 09, 2012 2:40 pm
Forum: System Dynamics Discussion
Topic: investment model, need help plz
Replies: 13
Views: 12109

Re: investment model, need help plz

It's always possible to build a model without units, and adding units won't in itself improve the model. However, in my experience grading hundreds of papers at MIT, it's extremely unlikely that a model will be good the first time. The process of adding units will reveal many conceptual inconsistenc...
by tomfid
Mon Jul 09, 2012 12:17 pm
Forum: Vensim
Topic: model to show interdependencies
Replies: 10
Views: 5362

Re: model to show interdependencies

I think you need to do something like the following: Treat your drivers as stocks, and your effects as auxiliaries, perhaps with lookup tables to capture any nonlinearity in the effects. Your stocks will have two flows, one associated with an exogenous policy test, and one associated with adjustment...
by tomfid
Thu Jul 05, 2012 9:10 pm
Forum: Vensim
Topic: Vensim 6.0 uninstall
Replies: 17
Views: 8874

Re: Vensim 6.0 uninstall

Actually it's fine to upload screenshots. Like most web fora, you can't copy/paste - you have to save the screenshot locally as a png or jpeg and then use the "upload attachment" tab to include it in your message.