Search found 2724 matches

by tomfid
Mon Sep 20, 2010 11:00 pm
Forum: Vensim
Topic: Sensitivity analysis input
Replies: 10
Views: 2665

You can use a file containing an actual sample of input parameters, not just distributions. You specify the name of the file in the sensitivity control file. Take a look again at Chapter 10 of the reference manual, e.g. File (use a file to specify parameters), if selected, will use a file to determi...
by tomfid
Mon Sep 20, 2010 10:48 pm
Forum: Vensim
Topic: vensim PLE question
Replies: 3
Views: 779

As long as you're using Euler or Diff integration, you can also use SMOOTH(p,TIME STEP).

It's worth pondering why you want a discrete delayed value - generally people are using this to either calculate derivatives or run discrete time models, both of which have pitfalls.

Tom
by tomfid
Sun Sep 12, 2010 8:44 pm
Forum: Vensim
Topic: custom graph
Replies: 5
Views: 1391

You can change this globally by adjusting the Horizontal setting on the Scaling tab of the Control Panel.
by tomfid
Tue Sep 07, 2010 10:44 pm
Forum: Vensim
Topic: Export data to Excel or something similar
Replies: 9
Views: 2670

It's a little more complicated than that. Take a look at venext.c in your Vensim comp directory. Your function could be almost as simple as the COSINE function example, if you're only writing one variable to a static output file. You'd still have to add some logic to open & close the file in simulat...
by tomfid
Tue Sep 07, 2010 6:08 pm
Forum: Vensim
Topic: Call vensim
Replies: 91
Views: 23342

Why not do this in GAMS? With undefined units and no dynamics (except maybe the "delayed" variable, which isn't used in the sample), it seems like you're not taking advantage of Vensim's strengths.

Tom
by tomfid
Tue Sep 07, 2010 6:02 pm
Forum: Vensim
Topic: Call vensim
Replies: 91
Views: 23342

Why not do this in GAMS? With undefined units and no dynamics (except maybe the "delayed" variable, which isn't used in the sample), it seems like you're not taking advantage of Vensim's strengths.

Tom
by tomfid
Tue Sep 07, 2010 1:00 pm
Forum: Vensim
Topic: Using Discrete Distributions in Sensitivity Analysis
Replies: 5
Views: 1027

Use INTEGER(x*10+0.5)/10
by tomfid
Tue Sep 07, 2010 2:16 am
Forum: Vensim
Topic: Call vensim
Replies: 91
Views: 23342

Also, when you look a the solution at the initial time step, is it reasonable?
by tomfid
Tue Sep 07, 2010 2:15 am
Forum: Vensim
Topic: Call vensim
Replies: 91
Views: 23342

Is this some kind of general equilibrium model? Some insight into the problem statement might help intuition about the solution. What is the origin of the time-varying behavior? Is it only the changing population? One possible reason that you don't have any units errors reported is that you haven't ...
by tomfid
Mon Sep 06, 2010 10:56 pm
Forum: Vensim
Topic: Export data to Excel or something similar
Replies: 9
Views: 2670

I think you'd have to write an external function to write the data to text. Fairly simple, but a lot of overhead to get started.

Tom
by tomfid
Mon Sep 06, 2010 9:29 pm
Forum: Vensim
Topic: Using Discrete Distributions in Sensitivity Analysis
Replies: 5
Views: 1027

INIT = INITIAL

INITIAL always has to appear first in an equation. I sometimes add an INIT macro to my models, so that I can write things like relativeX = x/INIT(x)

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

:END OF MACRO:
by tomfid
Sat Sep 04, 2010 1:11 am
Forum: Vensim
Topic: Call vensim
Replies: 91
Views: 23342

No problem, I'll answer to Bob. Unfortunately I don't have a copy of Matlab these days, and I've never connected it to Vensim. When you say you were not able to continue for more than 5 time steps with Vensim, what was the problem? Did the model crash, or was it simply too slow, or ... ? Vensim's FI...
by tomfid
Fri Sep 03, 2010 8:10 pm
Forum: Vensim
Topic: Call vensim
Replies: 91
Views: 23342

Your path C:\Vensimfloder\models\sample\ would be OK in XP - I don't know about Win7. But is it spelled Vensimfloder or Vensimfolder? You may have a typo.

Also, it appears that you have an extra ' in your model path, just before testlink: C:\Vensimfloder\models\sample\'testlink.vpm
by tomfid
Fri Sep 03, 2010 8:07 pm
Forum: Vensim
Topic: Call vensim
Replies: 91
Views: 23342

Out of curiousity, what are you trying to do here, i.e. what is the modeling purpose of calling Vensim from Matlab?
by tomfid
Fri Sep 03, 2010 6:36 pm
Forum: Vensim
Topic: Call vensim
Replies: 91
Views: 23342

Is there a typo in your matlab code at str=('SPECIAL>loadModel|C:\Vensimfloder\models\sample\'testlink.vpm') (extra ' before testlink)? Is "vensimfloder" a typo? It seems likely that there's some error in the matlab code, but no one here is a matlab expert, so you may do better on a matlab forum. Tom
by tomfid
Fri Sep 03, 2010 4:36 am
Forum: Vensim
Topic: Error Function in External Function
Replies: 7
Views: 2119

If you're using DSS, you can get a good approximation of ERF in a macro, without having to write an external function. See http://models.metasd.com/2010/05/cumula ... tribution/

Tom
by tomfid
Fri Sep 03, 2010 4:09 am
Forum: Vensim
Topic: Error on Symultaneous equation
Replies: 7
Views: 2074

In some cases it is possible to solve a problem with multiple simultaneous loops using FIND ZERO, which can take array arguments. An example would be a market clearing process, where supply and demand are simultaneous, and you have an array of prices that clears the market. However, in most cases, i...
by tomfid
Sun Aug 29, 2010 7:52 pm
Forum: Vensim
Topic: Age group control
Replies: 2
Views: 705

One simple example is here http://models.metasd.com/2010/03/world3-population-sector/ Normally a continuous aging process is most appropriate, but if you need to minimize dispersion through the age cohorts you can use the SHIFT IF TRUE function - see the documentation for a simple example of that. Tom
by tomfid
Sun Aug 29, 2010 6:11 pm
Forum: Vensim
Topic: Call MATLAB function from Vensim(Vnext.c)
Replies: 8
Views: 1621

You need to use the Matlab api to call it from C, per http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_external/f38569.html This is probably not a simple task. I think Vensim's FIND ZERO function is basically the same as fsolve, so you may be able to do what you're trying to do without M...
by tomfid
Sun Aug 29, 2010 6:05 pm
Forum: Vensim
Topic: vensim link matlab
Replies: 74
Views: 20403

5.9b is not particularly old, but evidently uses paths that don't work with Win7. I think what Bob is suggesting is that you should copy your C:\Program Files (x86)\Vensim\dll to another location, i.e. your user documents directory, because Win7 won't let them run where they are. No need to do any p...
by tomfid
Fri Aug 27, 2010 4:24 pm
Forum: Vensim
Topic: vensim link matlab
Replies: 74
Views: 20403

I think what Bob means is that you're back to using the original hfile = C:\Program Files (x86)\Vensim\dll\vendll.h where you should be using your modified hfile = C:\Users\mrj\Desktop\New folder (3)\vendll.h'

Tom
by tomfid
Fri Aug 27, 2010 1:18 am
Forum: Vensim
Topic: vensim link matlab
Replies: 74
Views: 20403

Maybe try giving it the full path then, e.g.

vendll = ['c:\windows\sysWOW64\vendll32.dll']; (or whatever the real path is)
hfile = ['C:\Users\mrj\Desktop\New folder (3)\vendll.h'];
loadlibrary( vendll , hfile);

?

Tom
by tomfid
Thu Aug 26, 2010 9:55 pm
Forum: Vensim
Topic: vensim link matlab
Replies: 74
Views: 20403

Above, you said:

Yes,I see the both of them in DLL subdirectory: VenDLL32.lib & Vendll.h

It sounds like your modified vendll.h is now OK. What you may still be missing is vendll32.dll (not .lib) in your system path.

Tom
by tomfid
Thu Aug 26, 2010 9:48 pm
Forum: Vensim
Topic: Call vensim
Replies: 91
Views: 23342

Presumably you can retrieve the model output into matlab with vensim_get_data and plot it that way, though I don't know how the matlab syntax for passing arrays would work. It's also possible to get the .dll to generate graphs with vensim_tool_command, but you have to be able to pass it a handle to ...
by tomfid
Tue Aug 24, 2010 7:57 pm
Forum: Vensim
Topic: vensim link matlab
Replies: 74
Views: 20403

Sorry about the name mistake. Did you look in your system folders to see if the .dll is installed?

Tom