Need Help...

Use this forum to post Vensim related questions.
Post Reply
stella
Junior Member
Posts: 3
Joined: Sun Jul 23, 2006 3:13 am

Need Help...

Post by stella »

Hi..

I am working on Vensim. I need the following requirement. Can you please tell me the procedure to achieve this.

I need to perform some iterations during a single period of time of my model run, in order to calculate a variable value. It is just like "For" loop in C language. Can you please suggest me how to achieve this.

For example: My model runs for a time step of 1 year.

I want to calculate one variable value iteratively, in this 1 year time step for some times. Can you please help me..

Bye..
Administrator
Super Administrator
Posts: 4835
Joined: Wed Mar 05, 2003 3:10 am

Post by Administrator »

Will the 'FIND ZERO' function help you?

There are also other ways of looping, such as using the MIN/MAX/SUM functions. If you can give a bit more info on what you are trying to evaluate maybe we can help some more.

All the best,

Tony.
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

iteration in a time step

Post by LAUJJL »

Hi

One way is to build variables subscripted with the dimension of the subscript approximately equal to the number of iterations expected and to make the variables equal to the values of the variables for each iteration.
joined a simplistic example that computes the limit of 1 / 2N
when N is increasing.
there is a closed loop between auxiliaries without a stock and no error because every time the variable changes its values the subscript changes too.
You need at least Vensim Pro to do this.
Regards.
JJ
Attachments
iteration.mdl
(1.5 KiB) Downloaded 362 times
Post Reply