Sum-Function in Vensim

Use this forum to post Vensim related questions.
Post Reply
marcow
Junior Member
Posts: 9
Joined: Fri Apr 18, 2008 1:51 pm

Sum-Function in Vensim

Post by marcow »

Hi!

For modelling my problem in Vensim I have to calculate the sum of a term ( I mean this Sigma sign. Sorry I don't know how it is called in English).

e.g.: Sum of (1-x)^i for i=1 to k with a variable k.
--> (1-x)^1+(1-x)^2+...+(1-x)^k

Does anybody know how to write an expression like that in Vensim? I have to calculate this in every period with a varying k.

Thx in advance,
Marco

[Edited on 5-23-2008 by marcow]
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

This is agebra - nothing to do with Vensim - the sum is

(1 - (1-x)^(k+1))/(1 - (1-x)) - 1 or simply

(1 - (1-x)^(k+1))/x - 1

check out http://en.wikipedia.org/wiki/Geometric_series for details
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

sum function in Vensim

Post by LAUJJL »

Hi

In case where there is no algebraic solution for another type of serie, here is an analytical solution of the problem written in Vensim. Vensim pro needed.
It is probably too possible to use a find zero loop.
Model is joined.
The maximum of k allowed is equal to the size of the subscript. If k is gretear than 20, increase the size of the subscript accordingly.
Regards.

[Edited on 24-5-2008 by LAUJJL]
Attachments
serie_model.mdl
(1.9 KiB) Downloaded 433 times
LAUJJL
Senior Member
Posts: 1477
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

sum function in Vensim

Post by LAUJJL »

Another model joined without subscript, but the summation is done through the time and not at every time step which limits the applicability of the method.
JJ
Attachments
serie_model_without_subscript.mdl
(1.96 KiB) Downloaded 395 times
Post Reply