Search found 2876 matches

by tomfid
Thu Feb 06, 2020 7:48 pm
Forum: Vensim
Topic: Stop When Reaching to Zero
Replies: 7
Views: 1238

Re: Stop When Reaching to Zero

An equally simple limit is: outflow = MIN( desired outflow, stock/TIME STEP ) The assumption here is that the dynamics of the constraint are not of much interest, so that it's OK to assume that the minimum outflow time is equal to TIME STEP. This is usually fine. This avoids having TIME STEP as an i...
by tomfid
Thu Feb 06, 2020 3:12 pm
Forum: Vensim
Topic: User-defined file setup in Sensitivity Simulation - for multiple parameters
Replies: 14
Views: 465

Re: User-defined file setup in Sensitivity Simulation - for multiple parameters

I would guess that it probably won't get far. It should be possible to optimize over a small sample for a few control parameters. We really need to get parallel simulation released - that's been held up by turbulence from the 64 bit changeover. However, there's a basic problem, which is that optimiz...
by tomfid
Thu Feb 06, 2020 3:07 pm
Forum: Vensim
Topic: Sample WORLD model has stocks modified by variables, without flows
Replies: 2
Views: 126

Re: Sample WORLD model has stocks modified by variables, without flows

If you're talking about World3, it does. This is basically a stylistic difference that shows its origin in DYNAMO. Those variables aren't levels, but they contain macro functions (SMOOTH) that have an internal state. So, they are drawn with a box to make that state visible. You could replace those w...
by tomfid
Thu Feb 06, 2020 3:00 pm
Forum: Vensim
Topic: Help with my SIR model
Replies: 12
Views: 341

Re: Help with my SIR model

It may be easier to debug if you switch to Euler integration (at least temporarily). It's harder to see the behavior internal to the time step with RK4. I think the problem here is with your "get sick" equation. You have k*infected*susceptible. There's immediately a problem here - imagine if half th...
by tomfid
Wed Feb 05, 2020 4:34 pm
Forum: Vensim
Topic: Help with my SIR model
Replies: 12
Views: 341

Re: Help with my SIR model

The units on "get better" (etc.) should be people/day. This model will not be stable as is, because the shortest time constant (recovery time) is 1/4 is shorter than the time step (see Model>Time Bounds). As a rule of thumb, the time step should be less than half the shortest time constant or delay....
by tomfid
Wed Feb 05, 2020 1:35 am
Forum: Vensim
Topic: Help with my SIR model
Replies: 12
Views: 341

Re: Help with my SIR model

Moving to the Vensim section.
by tomfid
Tue Feb 04, 2020 12:53 pm
Forum: Vensim
Topic: User-defined file setup in Sensitivity Simulation - for multiple parameters
Replies: 14
Views: 465

Re: User-defined file setup in Sensitivity Simulation - for multiple parameters

I would just include the things that vary - the rest could be left in a default cin file. Then you include the sample in a sensitivity simulation via a vsc using the File method.
by tomfid
Tue Feb 04, 2020 11:53 am
Forum: Vensim
Topic: User-defined file setup in Sensitivity Simulation - for multiple parameters
Replies: 14
Views: 465

Re: User-defined file setup in Sensitivity Simulation - for multiple parameters

In your case, you'd have to transpose your cin file(s) into a sensitivity sample file. This isn't as hard as it sounds. If you import a cin file into Excel, and use text to columns to break things at the =, you get a column of variable names and a column of values. Do this once per file, then merge ...
by tomfid
Mon Feb 03, 2020 1:58 pm
Forum: Vensim
Topic: User-defined file setup in Sensitivity Simulation - for multiple parameters
Replies: 14
Views: 465

Re: User-defined file setup in Sensitivity Simulation - for multiple parameters

When you say scenarios, do you mean that you have 4 files, each with a different set of variables, and you want to merge them, or ... ?
by tomfid
Sat Feb 01, 2020 1:24 am
Forum: Vensim
Topic: Unit checking questions
Replies: 3
Views: 193

Re: Unit checking questions

Embedded parameters like the 257.14 should be named as variables so that units can be assigned. This is also good practice because it exposes them to testing. If they're troublesome on the diagram, you can use the magic wand tool to hide them. For percent, we typically do something like the followin...
by tomfid
Fri Jan 31, 2020 4:06 pm
Forum: Vensim
Topic: How to download sample models
Replies: 3
Views: 204

Re: How to download sample models

The location of the Models directory varies by platform. Normally the full path for this directory is

•c:\Users\Public\Vensim\Models (Windows 7/8/10), or

•/Users/Shared/Vensim/Models (Macintosh)
by tomfid
Wed Jan 29, 2020 3:27 am
Forum: Ventity
Topic: There is no "yes" button on my license page and "Continue" is not clickable
Replies: 2
Views: 267

Re: There is no "yes" button on my license page and "Continue" is not clickable

I'm not sure I'm following ... can you post a screenshot?
by tomfid
Mon Jan 27, 2020 2:32 pm
Forum: Vensim
Topic: Hearne' method
Replies: 5
Views: 563

Re: Hearne' method

It seems impractical in a large model - just too many parameters to explore.
by tomfid
Mon Jan 27, 2020 2:30 pm
Forum: Vensim
Topic: Maximum value
Replies: 26
Views: 1914

Re: Maximum value

I think there may be a missing piece year - should min price be subscripted by year? If not,
min yearly price[EndUse Region]=SUM(min price[EndUse Region]*is year[year!]) = ]=min price[EndUse Region]*SUM(is year[year!])
by tomfid
Mon Jan 27, 2020 2:26 pm
Forum: Vensim
Topic: Data import: Interpolate but not Extrapolate..?
Replies: 4
Views: 173

Re: Data import: Interpolate but not Extrapolate..?

It sounds like you want interpolation in the middle of the series, and :NA: before/after there's any data. You could do that by combining the interpolated data with a logical test for the start end (using GET DATA FIRST TIME etc.). Be sure to wrap those statements in an INITIAL for efficiency (if it...
by tomfid
Sun Jan 26, 2020 4:08 pm
Forum: Vensim
Topic: Maximum value
Replies: 26
Views: 1914

Re: Maximum value

The initial value of the input would have to be 0. It's possible that there's a 0 in the initialization step, even if the dynamic value is nonzero. Hard to say more without seeing equations and data.
by tomfid
Sat Jan 25, 2020 11:14 pm
Forum: Vensim
Topic: Maximum value
Replies: 26
Views: 1914

Re: Maximum value

And you can also sample MAX TIME = SAMPLE IF TRUE ( A > MAX VALUE , Time, Time ) to capture when this occurs.
by tomfid
Thu Jan 23, 2020 3:04 pm
Forum: Vensim
Topic: A question about calculating median
Replies: 6
Views: 250

Re: A question about calculating median

How often do you need to update it? There might be a way to create a function to access it occasionally (e.g., monthly updates), so that the load is lower.

Is there some other robust statistic that would work?
by tomfid
Wed Jan 22, 2020 2:19 pm
Forum: Vensim
Topic: missing sensitivity analysis graph buttons
Replies: 2
Views: 108

Re: missing sensitivity analysis graph buttons

I think you're just short on screen space. You could try changing the toolbar icon sizes. Sometimes changing the display text scaling in the Win10 control panel may also help.
by tomfid
Wed Jan 22, 2020 1:27 pm
Forum: Vensim
Topic: Theil's inequality statistics model
Replies: 4
Views: 171

Re: Theil's inequality statistics model

Not sure what the problem is, but there's a working version here:
https://metasd.com/2011/04/theil-statistics/

The Theil statistics are also part of the standard Payoff Report.
by tomfid
Tue Jan 21, 2020 5:01 pm
Forum: Vensim
Topic: A question about calculating median
Replies: 6
Views: 250

Re: A question about calculating median

If you're running with a 1-hr time step, this will be VERY expensive computationally, because you'll be sorting an array of 8760 values every time step.

If the time step is larger, and the hour dimension is already in an array, it might work.
by tomfid
Tue Jan 21, 2020 3:52 pm
Forum: Vensim
Topic: demand and supply at price
Replies: 29
Views: 2755

Re: demand and supply at price

You've mixed up the subscripting by deleting the "demander" dimension. Therefore FIND MARKET PRICE is iterating over suppliers on one side of the market, and durations on the other side. The solution is to preserve the demander range, with length 1: demander : total Then use that in the demand varia...