Search found 11 matches

by PeterB
Wed Jun 25, 2008 2:20 pm
Forum: Vensim
Topic: Vensim in Spatial Models
Replies: 3
Views: 2702

Thanks Bob! Actually, for testing purposes, I have built a solution in Vensim which works perfectly for, say, 400 grid cells. It's based on a two-dimensional array and the exchange between cells is managed by using mapped subscripts. The 'big' model, however, should cover as many as 60.000 grid cell...
by PeterB
Wed Jun 25, 2008 9:46 am
Forum: Vensim
Topic: Vensim in Spatial Models
Replies: 3
Views: 2702

Vensim in Spatial Models

Dear Colleagues, I'm planning to build a grid based spatial model where a VENSIM model is simulating the processes happening on each cell and where a superordinate software is taking care for managing the exchange between cells. The number of cells will be to high for just solving this in Vensim wit...
by PeterB
Thu Apr 24, 2008 4:17 pm
Forum: Vensim
Topic: Initializing Levels from a Delphi application
Replies: 7
Views: 4265

Hi Tony,

many thanks for clarification. Now it works. Actually, I thought, INITIAL would be part of the command when a level is to be initialized.

What confused me when testing was that vensim_command() seems to always return 1 when the command starts with ".

Greetings
Peter
by PeterB
Thu Apr 24, 2008 2:47 pm
Forum: Vensim
Topic: Initializing Levels from a Delphi application
Replies: 7
Views: 4265

Hi Bob, may I bother you again? I'm not sure, but maybe there is a communication problem between VensimDLL and Delphi. Following your suggestion, I created a trivial Vensim model (Water Reservoir with constant inflow and Level-proportional outflow): Outflow Rate= 0.01 ~ 1/Second ~ | Outflow= Outflow...
by PeterB
Mon Apr 21, 2008 12:07 pm
Forum: Vensim
Topic: CDF-Function
Replies: 6
Views: 4267

Hi, when I posted my reply to Marco, I didn't notice that Bob had already answered. My post is not meant to be a comment to Bob. Just for curiosity I just tested the function from the link Bob mentioned. The approximation seems to be very good for most practical purposes (the first three digits afte...
by PeterB
Mon Apr 21, 2008 10:49 am
Forum: Vensim
Topic: CDF-Function
Replies: 6
Views: 4267

Hi Marco, I think what you need is more like this: Many spreadsheet programs like Excel provide built-in functions for the cumulative (standard) normal distribution and its inversion. You could use them to generate a distribution table and build a lookup in Vensim based on this. Another possibility,...
by PeterB
Fri Apr 18, 2008 4:50 pm
Forum: Vensim
Topic: Initializing Levels from a Delphi application
Replies: 7
Views: 4265

Hi Tony, hi Bob, thanks for your quick replies! In the meantime, I took some effort to check and reorganize everything (which improved my application quite a bit), but the problem persists. I don't load any CIN-file and I'm sure now that nothing happens between level initialization and simulation st...
by PeterB
Wed Apr 16, 2008 11:24 am
Forum: Vensim
Topic: Initializing Levels from a Delphi application
Replies: 7
Views: 4265

Initializing Levels from a Delphi application

Dear colleagues, I wrote a Delphi 5.0 application which controls a small Vensim model. Everything (starting, stopping simulations, getting data from the model during and after simulation) is fine, except that I don't manage to override the initial values of the levels from the application. Some line...
by PeterB
Mon Apr 07, 2008 12:49 pm
Forum: Vensim
Topic: vensim_get_val called from Delphi
Replies: 4
Views: 2878

Hi Bob,

thanks a lot! Using the following declaration (with 'stdcall' instead of 'far') did the trick:

function vensim_get_val(varname:PChar; varvals: SinglePtr): Integer ; stdcall ; external 'vendll32.dll' ;

vensim_get_val() now works in both versions of procedure B.

Greetings
Peter
by PeterB
Mon Apr 07, 2008 8:29 am
Forum: Vensim
Topic: vensim_get_val called from Delphi
Replies: 4
Views: 2878

Hi Bob, thanks for your quick reply. I tried and changed procedure B into this form: procedure B; var result, i: Integer; CurrentTime, CurrentValue: array[1..1] of Single; begin result := vensim_command('SIMULATE>RUNNAME|Current'); result := vensim_start_simulation(1,0,1); if result = 1 then begin w...
by PeterB
Fri Apr 04, 2008 1:55 pm
Forum: Vensim
Topic: vensim_get_val called from Delphi
Replies: 4
Views: 2878

vensim_get_val called from Delphi

Dear colleagues, when trying to get variable values from an ongoing vensim simulation into a Delphi 5.0-coded application I can't make the function vensim_get_val() work. However, after simulation it's easy to access the same variables with vensim_get_data(). To be more precise, here are the relevan...