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]
Sum-Function in Vensim
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
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
(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
sum function in Vensim
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]
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
sum function in Vensim
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
JJ
- Attachments
-
- serie_model_without_subscript.mdl
- (1.96 KiB) Downloaded 396 times